I have a class Utilisateur and class Evenement with a one-to-many association with the following code :
Code:
class Utilisateur
{
//...
Set evenements;
//...
}
class Evenement
{
//...
Utilisateur user;
}
The mapping file is :
<class name="com.cfort.calendrier.Evenement" table="evenement">
<id name="id" column="id">
<generator class="hilo"/>
</id>
<property name="moment" type="string" length="12"/>
<property name="debut" type="string" length="10"/>
<property name="fin" type="string" length="10"/>
<property name="titre" type="string" length="40"/>
<property name="description" type="string" length="200"/>
</class>
<class name="com.cfort.utilisateur.Utilisateur" table="utilisateur" >
<id name="identifiant" column="identifiant" type="string" length="20">
<generator class="assigned"/>
</id>
<property name="dateAbonnement" type="date"/>
<property name="datePaiement" type="date"/>
<property name="modeReglement">
<column name="modeReglement" sql-type="varchar(30)"/>
</property>
<property name="nbPoints" type="integer"/>
<set name="evenements">
<key column="utilisateur_numero"/>
<one-to-many class="com.cfort.calendrier.Evenement"/>
</set>
</class>
What does it mean if i modify the code in the mapping file by :
<set name="evenements" inverse="true">
<key column="utilisateur_numero"/>
<one-to-many class="com.cfort.calendrier.Evenement"/>
</set>
I read the documentation but i don't understand the explanations of inverse="true"
Thanks