Lets say I have to Grails domain classes: Car and Person.
class Car {
String model
...
Person driver
}
class Person {
String firstName
String lastName
}
I have a set of persons:
Set < Person >
How can I get a list of all Car instances that have drivers that are in that set?
So I’m assuming you have a set of person objects like so:
and you want to retrieve all cars that have one of the 3 drivers:
As long as the objects in the people list are instances of the Person domain you should be good to go.