14
我对使用静态hasOne地图和在域类中组合对象之间的差异有点困惑。两者有什么区别?即。Grails GORM组成还是hasOne?
class DegreeProgram {
String degreeName
Date programOfStudyApproval
static hasOne = [committee:GraduateCommittee]
}
与
class DegreeProgram {
String degreeName
Date programOfStudyApproval
GraduateCommittee committee
}
其中GraduateCommittee是另一个GORM域模型类。
我脱脂之前,但它并没有真正注册。在什么情况下,我想将父母的钥匙存放在孩子身上,而反之亦然? – 2009-12-09 19:19:26
@VisionarySoftwareSolutions我想这对于确保孩子不属于另一个父母很有用,因为它只能引用一个父母。 – 2014-04-24 11:31:54