class Person {
String name
Country bornInCountry
static embedded = ['bornInCountry']
}
class Country {
String name
}
如何按名称过滤人员?
当我在查询中使用名称(例如)时,Person会被bornInCountry.name过滤。Person.countByNameIsNotNull()
生成的sql loggingSql = true
:
Hibernate:
select
count(*) as y0_
from
person this_
where
this_.born_in_country_name is not null
代码取自grails 文档
grails 版本:2.5.3