I have a domain class Person
, as below
class Person {
static hasMany=[cars:Car]
}
Now, i want fetch all Person
, who doesn't own a 'Ford' car. The problem with below criteria is that, it fetches 'Person' with two cars, out of which one is 'Ford'.
List promotions = Person.createCriteria().list( ) {
cars {
ne(‘name’, ‘Ford’)
}
}