1
我有三个对象:的Grails GORM搜索匹配另一个列表列表项
老师, 儿童,家长
Teacher.students是儿童的对象列表
Parent.children是也是子对象列表
我想找到所有教授某位家长孩子的教师。
我试过这个,但它只找到一个孩子的老师。如果父母有多个孩子,我需要这个工作。
def teachers = Teacher.withCriteria{
students {
inList("id", parent.children.first().id)
}
}