With Book and Author domain classes as follows:
class Book {
static belongsTo = Author
static hasMany = [authors:Author]
String title
}
class Author {
static hasMany = [books:Book]
String name
}
How would I find the book by an author that has the title "Grails"?
I tried this but it didn't work (No signature of method: org.hibernate.collection.PersistentSet.findByTitle() is applicable for arguemnt types: (java.lang.String) value: [Grails].
Author author = Author.get(1)
def book = author.books.findByTitle("Grails")