2009-07-23 24 views
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" 

回答

1

t.TreatmentTime?


编辑:

从下面的评论,因为我的答案是不明确的,在所有的(对不起)

取代:

sum(TreatmentTime) 

sum(t.TreatmentTime) 
+0

我需要时间的总和。 – Jay 2009-07-23 14:47:32

+0

呀,但不是TreatmentTime是TherapySession的成员吗? – anonymous 2009-07-23 15:17:05

+0

想象一下你会写的SQL ...选择t.TreatmentDate,从TherapySession t组中总结(t.TreatmentTime)t.TreatmentDate ...对吗? (忽略病人/学科的东西atm)。 – anonymous 2009-07-23 15:18:12

相关问题