I'm having problems getting the right hbm.xml for mapping a Many-to-One relationship over a link table:
<class name="Car" table="Cars" lazy="true">
<id name="CarKey" type="int">
<generator class="native" />
</id>
[properties]...
<many-to-one ??? />
</class>
<class name="Driver" table="Drivers" lazy="true">
<id name="DriverKey" type="int">
<generator class="native" />
</id>
[properties]...
</class>
<class name="CarDriverLink" table="CarDriverLinks" lazy="true">
<id name="CarDriverLinkKey" type="int">
<generator class="native" />
</id>
<property name="CarKey">
<column name="CarKey" sql-type="int" not-null="true" />
</property>
<property name="DriverKey">
<column name="DriverKey" sql-type="int" not-null="true" />
</property>
</class>
Imagining that in this example a car can have only one driver, but a driver can have multiple cars, how would I add a many-to-one relationship onto the Car mapping to allow a Car to see which Driver can drive it, using the CarDriverLinks table?