How to map relations to abstract domain classes?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to map relations to abstract domain classes?

Martin Hofmann-Sobik
Hi,

is it possible to define a relation to an abstract class and choose in
the concrete subclass which is the relation target?
Here's a pseudo code example of what I want to do:

in src/groovy:
abstract class Connection {
     Location from
     Location to
}

abstract class Location {
     String city
}

in grails-app/domain:
TrainConnection extends Connection {
           static mapping = {
               from(targetEntitity: Station)
               to(targetEntitity: Station)
           }
}

Station extends Location {
}


Thanks in advance for your help.
Martin

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email