【发布时间】:2014-02-17 18:00:55
【问题描述】:
我有这 4 个课程:
class Animal {
static hasMany = [legs: Leg]
}
class Cat extends Animal {
static hasMany = [legs: CatLeg] // Should I remove this line?
}
class Leg {
static belongsTo = [animal: Animal]
}
class CatLeg extends Leg {
static belongsTo = [animal: Cat] // Should I remove this line?
}
这样可以吗?是否有必要或建议在子类中再次声明这些变量?添加或省略它们有什么区别?
我目前正在使用 Grails 2.2.2。
谢谢,
乔迪
【问题讨论】:
标签: grails grails-domain-class