I am trying to implement two different types of relationships between two domain classes in Grails.
Consider the following; I have two domain classes, an Author and Book
Finally figured this out. Thanks to Don for pointing me in the direction of the db-reverse-engineer plugin which helped expose the key property that allows for this mapping strategy. Basically it all came down to using GORM's mappedBy association setting to explicitly tell Grails how the multiple hasMany references should be mapped. The class files that worked are as follows:
class Author {
String name
static hasMany = [books: Book, favourites: Book]
// need to disambiguate the multiple hasMany references with the
// 'mappedBy' property:
static mappedBy = [books: "author",
favourites: "authors"]
}
class Book {
String title
Author author
static hasMany = [authors: Author]
static belongsTo = [Author]
}
Thanks again for the help