使用域實例Grails中查找子域,我怎麼找到的子域使用域實例Grails中
讓說,我有
class Family {
Integer id
Parent parent
}
class Parent {
Interger id
static hasMany = [children: Child]
}
class Child {
String name
}
所以在控制器,
Parent mom = Family.findById(1).parent
所以現在,如何使用mom
在父母中獲得name == "Child"
的孩子?
它甚至有可能嗎?
這在這個特定情況下適用於我,但我會牢記這些文檔。謝謝 – StrandedHere