Reputation: 966
Given the following (pseudo code) structure:
abstract AbstractClass (in src/groovy)
And in grails-app/domain
class ExtendedClassA extends AbstractClass
class ExtendedClassB extends AbstractClass
How do I define that ParentClass (in grails-app/domain) hasMany "extended" classes?
class ParentClass
static hasMany = [things:AbstractClass]
ie. any class that extends the AbstractClass can be included as a "child" of ParentClass
Thanks in advance
Upvotes: 0
Views: 109
Reputation: 20699
Create an abstract domain
class extending your src/groovy/AbstractClass
and there define your hasMany
Upvotes: 1