查询组成如下:
def subQuery = {
ge("date", fromDate)
}
def query = {
projections {
sqlProjection 'sum(hoursBefore+hoursAfter) as totalHours', 'totalHours', INTEGER
}
and subQuery
}
然后执行如下:
def results = WorkLog.createCriteria().get(query)
我得到错误:
没有这样的属性:INTEGER 类:grails.orm.HibernateCriteriaBuilder
知道如何解决这个问题吗?