Bonjour,
J'ai une table avec une table de lien, j'utilise HibernateTools pour le mapping qui me génère les fichiers suivant :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 30 ao?t 2007 10:34:54 by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="com.cnes.regates.preparation.modeleDonnees.DAONoeud" table="noeud" catalog="regates">
<comment></comment>
<id name="idNoeud" type="int" unsaved-value="0">
<column name="idNOEUD" />
<generator class="identity" />
</id>
<property name="nom" type="string">
<column name="nom" length="20" not-null="true">
<comment></comment>
</column>
</property>
<set name="DAONoeudNoeudsForIdNoeudpere" inverse="true">
<key>
<column name="idNOEUDPere" not-null="true">
<comment></comment>
</column>
</key>
<one-to-many class="com.cnes.regates.preparation.modeleDonnees.DAONoeudNoeud" />
</set>
<set name="DAONoeudNoeudsForIdNoeudfils" inverse="true">
<key>
<column name="idNOEUDFils" not-null="true">
<comment></comment>
</column>
</key>
<one-to-many class="com.cnes.regates.preparation.modeleDonnees.DAONoeudNoeud" />
</set>
</class>
</hibernate-mapping>
Et
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 30 ao?t 2007 10:34:54 by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="com.cnes.regates.preparation.modeleDonnees.DAONoeudNoeud" table="noeud_noeud" catalog="regates">
<comment></comment>
<composite-id name="id" class="com.cnes.regates.preparation.modeleDonnees.DAONoeudNoeudId">
<key-property name="idNoeudpere" type="int">
<column name="idNOEUDPere" />
</key-property>
<key-property name="idNoeudfils" type="int">
<column name="idNOEUDFils" />
</key-property>
</composite-id>
<many-to-one name="DAONoeudByIdNoeudfils" class="com.cnes.regates.preparation.modeleDonnees.DAONoeud" update="false" insert="false" fetch="select">
<column name="idNOEUDFils" not-null="true">
<comment></comment>
</column>
</many-to-one>
<many-to-one name="DAONoeudByIdNoeudpere" class="com.cnes.regates.preparation.modeleDonnees.DAONoeud" update="false" insert="false" fetch="select">
<column name="idNOEUDPere" not-null="true">
<comment></comment>
</column>
</many-to-one>
</class>
</hibernate-mapping>
Mon problème est que lorsque je select DAONoeud les collections DAONoeudNoeudsForIdNoeudpere et DAONoeudNoeudsForIdNoeudfils ne sont jamais remplis. Quelqu'un aurrait une idée du pourquoi ? Merci.