nhibernate:无法确定聚合的数据类型

时间:2009-07-23 14:06:14

标签: nhibernate

有任何建议如何解决此错误? (我宁愿不创建一个sql视图来解决与总和聚合的问题)

“无法提取HQL函数的一个参数的类型:expression-> {TreatmentTime};检查别名。[select new TherapyMinutesDisciplineByDayDTO(sum(TreatmentTime),2.0,3.0,t.TreatmentDate,p.LastName ,d.Description)来自TherapyMinutesModule.TherapySession t join t._Patient p join t._Discipline d group by t.TreatmentDate,p.LastName,d.Description]“

这是hql:

                    c.HSQL = "select"
                     + " new TherapyMinutesDisciplineByDayDTO( sum(TreatmentTime), 2.0, 3.0, t.TreatmentDate, p.LastName, d.Description )"
                     + " from TherapySession t"
                     + " join t._Patient p"
                     + " join t._Discipline d"
                     + " group by t.TreatmentDate, p.LastName, d.Description"

1 个答案:

答案 0 :(得分:1)

t.TreatmentTime?


编辑:

以下评论,因为我的答案根本不清楚(对不起)

取代:

sum(TreatmentTime) 

sum(t.TreatmentTime)