我有域类:Grails的渴望获取不检索所有数据
class Person {
static hasMany = [ items: Item ]
static fetchMode = [ items: 'eager' ]
String name
Set items
}
class Item {
static belongsTo = [ owner: Person ]
String name
}
如果我留在原地static fetchMode = [ items: 'eager' ]
,然后调用getItems()
只返回项目的10%左右。如果我删除fetchMode,则getItems()
将返回所有项目。任何想法为什么渴望获取结果检索少于所有存储的数据?
请将您的问题的答案作为_answer_分享,然后接受答案,否则此问题将继续留在我们的“未答复的问题”列表中。如果问题不再相关,请举报主持人注意。 – 2011-02-23 07:21:35