I have an entity model where the base class in an inheritance structure has an association with another class, and was wondering if the subtypes of the base class will have the association mapped up as well?
For a bit more information, here is a basic outline of this part of the system:
Transport is the base class, and has an association with Owner. Bike and Car are two of the subclasses.
They are represented in 3 tables with the same names using Table Per Subclass inheritance structure. The Transport table holds the foreign key reference to Owner.
This is how I this the mapping should work, am I correct? I haven't seen anything around addressing this so I thought it would be a good question for SO.
<class name="Transport" table="TRANSPORT">
<id name="Id" type="Int64" column="Transport_ID">
<generator class="native"/>
</id>
<many-to-one name="Owner" column="Owner_ID" />
<joined-subclass name="Bike" table="BIKE">
<key column="Bike_ID"/>
</joined-subclass>
<joined-subclass name="Car" table="CAR">
<key column="Car_ID"/>
</joined-subclass>
</class>