I mean swapping them with each other. Like this:
Instead of this mapping:
Code:
<class name="WorkingPerson" table="person">
<id .... >
<generator ... />
</id>
<property name="name" column="name"/>
<join table="profession" inverse="true">
<key column="profid"/>
<property name="name" column="name"/>
</join>
</class>
Use this mapping:
Code:
<class name="WorkingPerson" table="profession">
<id .... >
<generator ... />
</id>
<property name="name" column="name"/>
<join table="person"> <!-- remove inverse="true" -->
<key column="profid"/>
<property name="name" column="name"/>
</join>
</class>
Looking closer at the document example, perhaps it's not so clear. The PERSON table has an ADDRESS_ID column which FKs to the ADDRESS table.
Code:
<class name="Person"
table="PERSON">
<id name="id" column="PERSON_ID">...</id>
<join table="ADDRESS">
<key column="ADDRESS_ID"/>
<property name="address"/>
<property name="zip"/>
<property name="country"/>
</join>
This is not the way I have it set up in some working code of mine. I have the table referenced by the <join> having a FK column to the table referenced by the <class>, which is why I suggested swapping them.