Hibernate version: 3.0b4
I've tried this question over at the H3 forum, but perhaps it's applicable
here as well.
I would like to map an inheritance hierarchy which is very wide but not
very deep, in such a way that would not require me to create a mapping for each of the derived classes, as they vary only in
behaviour, but get Hiberanate to instantiate the appropriate type based on
class/type information that is stored in the database as a column.
An example of the type of model I want to persist is a set of Command
objects - they all share pretty much all the associated info about the
command like parameters, source/target objects, etc. However, the
behaviour, as you'd expect varies widely.
Is it possible to do? My current thinking is that I would have to have a
proxy of sorts which itself is mapped to the database, persisting the
appropriate proxied type in the database and upon loading, would
instantiate the actual type... Is there an easier way?
_________________ Cheers,
Bonny
please don't forget to rate :)
|