It's not to support multiple inheritance (i.e. a class with two parents) it's to support
multi-level inheritance. Multi-level is fairly intuitive when using table-per-subclass, but not when it comes to table-per-hierarchy.
Say my class hierarchy is the following, and I want to use table-per-hierarchy:
Cat
--DomesticCat
-----Persian
-----Manx
--WildCat
-----Tiger
-----Lion
What I'd like to do is create the table CAT with discriminator columns TYPE and SUB_TYPE.
TYPE can have the values "DOMESTIC" and "WILD".
SUB_TYPE can have the values "PERSIAN", "MANX", "LION" and "TIGER".
The mapping would look something like:
Code:
<class name="Cat">
<discriminator column="TYPE">
<subclass name="DomesticCat" discriminator-value="DOMESTIC">
<discriminator column="SUB_TYPE">
<subclass name="Persian" discriminator-value="PERSIAN"/>
<subclass name="Manx" discriminator-value="MANX"/>
</subclass>
<subclass name="WildCat" discriminator-value="WILD">
<discriminator column="SUB_TYPE">
<subclass name="Tiger" discriminator-value="TIGER"/>
<subclass name="Lion" discriminator-value="LION"/>
</subclass>
</class>