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 插入简单 id
,又名 Manual references
在蒙戈
关于grails - Gorm : What is reference:true in Grails domain class mapping block?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30185330/