【发布时间】:2011-01-02 06:09:58
【问题描述】:
我正在尝试使用 GORM 查询以下 HQL:
MailMessage.executeQuery("toId, count(toId) from (SELECT toId, threadId FROM MailMessage as m WHERE receiveStatus = 'u' GROUP BY threadId, toId) as x group by x.toId")
问题是count(toId) 是MailMessage 中不存在的计算字段,并且我正在使用子查询。
我收到以下错误:java.lang.IllegalArgumentException: node to traverse cannot be null! 理想情况下,我想使用一个通用的 executeQuery,它将返回任何类型的数据。有这种事吗?
【问题讨论】:
标签: hibernate grails groovy hql grails-orm