I have mixed table per class with table per subclass hierarchy like this:
Code:
<class name="ClassA" table="TBL_A" >
<discriminator column="discr" type="string" />
<!-- some properties of class A here -->
</class>
<subclass name="ClassB" extends="ClassA" discriminator-value="typeB" >
<join table="TBL_B">
<key ....>
<!-- some properties of class B here -->
</join>
</class>
I have class C inherited from B. I want to store properties of ClassC in
TBL_B so
Code:
<subclass name="ClassC" extends="ClassB" discriminator-value="typeC" >
<!-- some properties of class C here -->
<subclass/>
will store properties in root hierarchy class table - TBL_A
Code:
<subclass name="ClassC" extends="ClassB" discriminator-value="typeC" >
<join table="TBL_B">
<key ....>
<!-- some properties of class C here -->
</join>
<subclass/>
will not work correctly
Code:
<subclass name="ClassC" extends="ClassА" discriminator-value="typeC">
<!-- inherit mapping from ClassА with copy-paste properties of B-->
<join table="TABLE_B">
<key ....>
<!-- some properties of class B here -->
<!-- some properties of class C here -->
<join/>
<subclass/>
does not support polymorphyc querries by ClassB
So i did not find solution on
http://docs.jboss.org/hibernate/core/3. ... tance.html Is this kind of mapping mixture is imposible in hibernate?