Grails many-to-many - find all objects that contain specific list of objects
<p>I have following domain model:</p>

<pre><code>class Recipe {
    String title
    static hasMany = [ ingredients : Ingredient ]
}

class Ingredient {
    String ingredient
    static hasMany = [ recipes : Recipe ]
    static belongsTo = Recipe
}
</code></pre>

<p>Grails created the table RECIPE_INGREDIENTS with the ingredient ID and recipe ID.</p>

<p>How can I get a list of recipes with passing a list of ingredients?</p>

<pre><code>def egg = new Ingredient(ingredient:"Egg")
def milk = new Ingredient(ingredient:"Milk")
def flour = new Ingredient(ingredient:"Flour")
def apple = new Ingredient(ingredient:"Apple")
def banana = new Ingredient(ingredient:"Banana")
def mango = new Ingredient(ingredient:"Mango")


def pizza = new Recipe(title:"Pizza")
pizza.addToIngredients(egg)
pizza.addToIngredients(milk)
pizza.addToIngredients(flour) 
pizza.save()

def salad = new Recipe(title:"Fruit Salad with milk")
salad.addToIngredients(apple)
salad.addToIngredients(banana)
salad.addToIngredients(mango)
salad.addToIngredients(milk)
salad.save()
</code></pre>

<p>for example:</p>

<pre><code>[mango, milk] return me salad
[milk] return me salad and pizza
[milk, flour] return me pizza
</code></pre>