The error only happens when I use the 'between' inside of an association in a DetachedCriteria:
Error:
org.hibernate.QueryException: could not resolve property: execution_alias1 of: ExecutionService
Criteria:
new DetachedCriteria(Service).build {
execution {
between('date', new Date() -1, new Date())
}
}.list()
Domain Classes:
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 version: 3.1.8