If I have a Client domain class, and that Client hasMany Courses. How do I find the course I'm looking for? For instance:
class Client {
String name
static hasMany = [courses:Course]
}
class Course {
String name
static belongsTo = [client:Client]
}
def client = Client.get(1)
I want to "find" or "search" within that courses relationship. Maybe something like:
client.courses.find(name:'Whatever')
Is there any way to do this with Grails?