Either I'm having reading problems today, or I found another error. In
1.3.6. Working bi-directional links I read:
Quote:
The rules you have to remember are straightforward: All bi-directional associations need one side as inverse. In a one-to-many association it has to be the many-side, in many-to-many association you can pick either side, there is no difference.
Then, looking at
7.4.1. one to many / many to one I see
Code:
<class name="Person">
<id name="id" column="personId">
<generator class="native"/>
</id>
<many-to-one name="address"
column="addressId"
not-null="true"/>
</class>
<class name="Address">
<id name="id" column="addressId">
<generator class="native"/>
</id>
<set name="people" inverse="true">
<key column="addressId"/>
<one-to-many class="Person"/>
</set>
</class>
To me, it looks as though many people can live at one address. So people is the many-side, correct? But the inverse attribute is not in Person (=people), but in Address!
Then, in
7.5.1. one to many / many to one I read:
Quote:
Note that the inverse="true" can go on either end of the association, on the collection, or on the join.
How does this all fit together? I guess if a join table is used (§7.5.1), then the first quote does not count. OK - this information should be added in §1.3.6. But what about the many-side mix-up in §7.4.1.?