我有域类:
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()
返回所有项目。知道为什么急切获取会导致检索不到所有存储的数据吗?
2011 年 2 月,这已被确定为bug http://www.blueleftistconstructor.com/2011/10/12/grails-broken-list-on-domain-object-fetchmode-eager-wait-no-join/在 Grails 1.04 中,根据grails.org http://jira.grails.org/browse/GRAILS-995。截至 2012 年 7 月,该 bug 被列为已关闭,因此该问题应该已得到解决。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)