Joined-subclass is a mapping strategy in Hibernate and NHibernate that is also known as "Table per subclass".
Joined-subclass mapping is a mapping strategy in Hibernate and NHibernate where a superclass A
is mapped to its own table and all subclasses that extend A is mapped to their own table, but with a join to A
's table. Only the properties defined at each level in the inheritance hierarchy will be stored in corresponding columns in each class' database table.
When selecting a derived class B
from the database, Hibernate does a select on A
with a left outer join
on B
as well as all other classes extending from A
. Depending on which left outer join
returns any data, Hibernate constructs a new instance of the correct class (in this case, B
) and fills it with data from table A
and B
.