public class Address {
static mapWith = "mongo"
Region region;
Zone zone;
static mapping = {
id generator: 'identity'
region reference:true
zone reference:true
}
}
我有兴趣知道会reference:true
做什么。
以我的经验,除非DBRef
在实际的mongo文档中没有任何内容,否则将其保留会得到完全相同的结果。
看起来像reference
控制文档如何链接。
当时true
,相关文档由db-refs引用,如果false
,GORM在mongo中插入simple id
,又名Manual references
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句