【发布时间】:2017-10-01 23:32:57
【问题描述】:
只有当我在 DetachedCriteria 中的 association 中使用“between”时才会发生该错误:
错误:
org.hibernate.QueryException: 无法解析属性:execution_alias1 of: ExecutionService
标准:
new DetachedCriteria(Service).build {
execution {
between('date', new Date() -1, new Date())
}
}.list()
域类:
class Service{
static hasOne = [execution: ExecutionService]
static constraints = {
execution nullable: true
}
}
class ExecutionService {
Date date
static belongsTo = [servico: Servico]
static constraints = {
date nullable: true
servico nullable: true
}
}
OBS:Grails 版本:3.1.8
【问题讨论】:
标签: grails hibernate-criteria detachedcriteria