1
任何建议如何解决此错误? (我宁愿不创建一个SQL视图来避开总和聚合的问题)nhibernate:无法确定聚合的数据类型
“无法提取HQL函数的一个参数的类型:表达式 - > {TreatmentTime};检查别名。新的TherapyMinutesDisciplineByDayDTO(sum(TreatmentTime),2.0,3.0,t.TreatmentDate,p.LastName,d.Description)from TherapyMinutesModule.TherapySession t join t._Patient p join t._Discipline d group by t.TreatmentDate,p.LastName,d 。说明]”
这里的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"
我需要时间的总和。 – Jay 2009-07-23 14:47:32
呀,但不是TreatmentTime是TherapySession的成员吗? – anonymous 2009-07-23 15:17:05
想象一下你会写的SQL ...选择t.TreatmentDate,从TherapySession t组中总结(t.TreatmentTime)t.TreatmentDate ...对吗? (忽略病人/学科的东西atm)。 – anonymous 2009-07-23 15:18:12