Hello,
i have the following "Table per Class" szenario: C extends B and B extends A (with C and B inheriting the primary key ("id") of A) .
Which basically means that when an Object of Type C is created. All basic properties will be stored in the superclass A where the primary key is generated, the subproperties will be stored in B, and the Type specific properties in C. With a join over all 3 Tables using the common primary key, i get the full object C.
B extends A is easy to implement in a hbm.xml file with the <joined-subclass> Tag.
Code:
<class name="A">
<id name="id"><generator class="native" /></id>
<property name="..." />
<joined-subclass name="B" table="B">
<key column="id" />
<property name="..." />
</joined-subclass>
</class>
But how can i implement "C extends B" , so that C inherits the primary key of B.
If there is an easier way with Annotations tell me. I am used to hbm.xml-files but its not working all the ways i tried it.
Many thx in advance!
Michael