A third option is to map only the concrete classes of an inheritance hierarchy to tables, (the table-per-concrete-class strategy) where each table defines all persistent state of the class, including inherited state. In Hibernate, it is not absolutely necessary to explicitly map such inheritance hierarchies. You can simply map each class with a separate <class> declaration. However, if you wish use polymorphic associations (e.g. an association to the superclass of your hierarchy), you need to use the <union-subclass> mapping.
<union-subclass
name="ClassName"
table="tablename"
proxy="ProxyInterface"
lazy="true|false"
dynamic-update="true|false"
dynamic-insert="true|false"
schema="schema"
catalog="catalog"
extends="SuperclassName"
abstract="true|false"
persister="ClassName"
subselect="SQL expression"
entity-name="EntityName"
node="element-name">
<property .... />
.....
</union-subclass>
name: The fully qualified class name of the subclass.
table: The name of the subclass table.
proxy (optional): Specifies a class or interface to use for lazy initializing proxies.
lazy (optional, defaults to true): Setting lazy="false" disables the use of lazy fetching.
No discriminator column or key column is required for this mapping strategy.
For information about inheritance mappings, see Chapter 9, Inheritance Mapping.