Grails 文档指出,
class Person {
..
static mapping = {
table 'people'
cache true
}
}
“将配置一个包含惰性和非惰性属性的‘读写’缓存。”
如果我们在 Person 中有一对多的关系,例如:
static hasMany = [addressess: Address]
grails 是否将其视为惰性属性?Address 对象是否也被缓存,或者只有与给定 Person 相关的 id 被保存在缓存中?