Hi,
I was wondering how to do a simple per-class-hierarchy mapping for an object graph 3 levels deep. For example, say I want to map the abstract base classes X <-- Y <-- Z. I assumed you can nest the <subclass> element in order to achieve this but I'm not getting the result I want when hibernate generates the schema. Here is my map:
Code:
<class name="X" table="X">
<id name="id" type="long" column="X_ID">
<generator class="native"/>
</id>
<discriminator column="X_TYPE" type="string"/>
...
<subclass name="Y">
<subclass name="Z">
</subclass>
...
</subclass>
</class>
I would assume this is the correct way but I know it is not since I'm not getting the schema generated accordingly (Y and Z are linked to X). Any help would be appreciated. Thanks!