Mormally setting up one-to-many associations is easy. Take for example:
class Author {
String firstName
String lastName
static hasMany = [books: Book]
static constraints = {
books(nullable: true)
}
}
class Book {
String title
Author author
Publisher publisher
static constraints = {
author(nullable: true)
publisher(nullable: true)
}
}
However, if I've already setup the Author domain without knowing Book at all, there is no static hasMany = [books: Book]
specified initially. Later, I want to add a Book domain and want to add static hasMany = [books: Book]
to Author. Could I do this with a plugin? If so, how?
Thanks.