Is there a way to create an association to an arbitrary domain object in grails?
Something like
class ThingHolder {
DomainObject thing;
}
and then
Book b=new Book(title: "Grails 101").save()
Author a=new Author(name: "Abe").save()
ThingHolder t1=new ThingHolder(thing:b).save()
ThingHolder t2=new ThingHolder(thing: a).save()
So that
ThingHolder.get(t1.id).thing // will be a Book
and
ThingHolder.get(t2.id).thing // will be an Author.