I'm facing the very same problem.
I would like to have the following hierarchy:
Code:
<class name="Name" schema="prod" table="names">
<id name="id"><generator class="native"/></id>
... some properties spec ...
</class>
... some other <joined-subclass> of Name ...
<joined-subclass name="CategoryAttribute"
extends="Name"
===> abstract="true"
>
<key column="idName"/>
===> <discriminator column="type"
type="String"
length="1"
not-null="true"
/>
... some shared properties ...
</joined-subclass>
<subclass name="StringCategoryAttribute"
extends="CategoryAttribute"
discriminator-value="S"
schema="prod" tab="stringCatAttributes"
>
... properties unique to this class ...
</subclass>
<subclass name="NumericCategoryAttribute"
extends="CategoryAttribute"
discriminator-value="N"
schema="prod" tab="numericCatAttributes"
>
... properties unique to this class ...
</subclass>
but the elements and attributes marked with a '===>' are not supported by the Hibernate DTD. Not even to mention that, probably, an abstract <joined-subclass> means that the Hibernate code has to "migrate" the semantic of the <key> element to the implementing <subclass>es...
I'm trying to evinct an alternative way of specifying this, but I'm not shure if it exists and pretty shure it is less strightforward...
Please also note that a question like this is also expressed in
http://forum.hibernate.org/viewtopic.php?t=944767&highlight=mixing+hierarchy, so at least we don't feel alone in the darkness. :)
Regards