2009-07-23 56 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

相關問題