0
我有这个类:找到家长通过孩子一对多关系的Grails
class Parent{
static hasMany = [children:Child]
}
class Children{
static belongsTo = [Parent]
}
我要像做
Parent.findByChildren(ChildInstance)
在数据库中不存在与关系ID的一个表,但我不知道如何访问它。
但是,这不行,这是正确的方式?
感谢
孩子没有提及父母,我想避免的是迭代数据库中的所有父母。 –
查看上面的编辑。 – elixir