I've got 2 objects: Country and Language
Between these is a many-to-many relation which has additional properties.
So I've made an Object for this relation: CountryNames.
I have the following mappings:
Code:
<class name="data.Country" table="countries">
<id name="id" column="id" length="20">
<generator class="assigned" />
</id>
</class>
<class name="data.Language" table="languages">
<id name="id" column="id" length="10">
<generator class="assigned" />
</id>
</class>
<class name="data.CountryName" table="countryNames">
<composite-id name="fk" class="data.CountryNameFK">
<key-property name="country" />
<key-property name="language" />
</composite-id>
<many-to-one name="country" class="data.Country" column="country" />
<many-to-one name="language" class="data.Language" column="language" />
<property name="name" column="name" />
</class>
How can I map the connections from Country and Language to CountryName?
And I can't test it yet, but should the foreign key's from CountryName work?