In Hibernate each subclass can also be mapped to its own table. We called to this is table-per-subclass mapping strategy. An inherited state is retrieved by joining with the table of the superclass. For doing this need to use this <joined-subclass> element.
For example:
<joined-subclass
name="ClassName"
table="tablename"
proxy="ProxyInterface"
lazy="true|false"
dynamic-update="true|false" dynamic-insert="true|false" schema="schema" catalog="catalog" extends="SuperclassName" persister="ClassName" subselect="SQL expression" entity-name="EntityName" node="element-name"> <key .... > <property .... /> ..... </joined-subclass>
Here is the description of the all above:
Tag |
Description |
name |
fully qualified class name of the subclass |
table |
the name of the subclass table |
proxy (optional) |
specifies a class or interface used for lazy initializing proxies |
lazy (optional) |
defaults to true. setting lazy="false" disables the use of lazy fetching |