Hi.
Online tutorial (3.2) says, in section 1.3.6.( Working bi-directional links ) says:
----------------------------------------------------------------------------------------------------
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.
----------------------------------------------------------------------------------------------------
But in section 7.4.1. (one to many / many to one) one can see:
-----------------------------------------------------------------------------------------------------
<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>
------------------------------------------------------------------------------------------------------
I am getting it wrong or the "inverse" attribute is set, in this example, on the "one" side? Also, is true that "inverse" attribute HAS to be in one of the sides? I think it works with both...
_________________ andresgr (--don't forget to rate)
|