GORM: What is reference:true in Grails domain class mapping block? -
public class address { static mapwith = "mongo" region region; zone zone; static mapping = { id generator: 'identity' region reference:true zone reference:true } }
i'm interested in knowing reference:true
does.
in experience, leaving off gives same result except there's no dbref
in actual mongo document.
it looks reference
controlls how documents linked.
when true
, related documents referenced db-refs, if false
, gorm inserts simple id
, aka manual references
in mongo
Comments
Post a Comment