Grails named queries: find parents of child A and child B
问题 I have this: class Parent { String name static hasMany = [children: Child] } class Child { String name } And I want to find all the parents that have a child named "Tom" and another one named "Sam". id | parentName --------------- 1 | Peter 2 | Joe 3 | Ann id | childName --------------- 1 | Tom 2 | Sam idParent | idChild --------------- 1 | 1 2 | 2 3 | 1 3 | 2 In the example, it will be Ann. I've tried this: static namedQueries = { findParents{nameList -> children{ nameList.each{childName->