Hi,
I don't understand how come the list of division contains null values !
Session session = getSessionFactory().openSession();
Grille grille = (Grille) session.load(Grille.class, new Long(id));
for (Iterator divIdx = divisionList.iterator(); divIdx.hasNext();) {
Divisions div = (Divisions) divIdx.next();
div.getId(); <<<<<<<<<<<<<<<< bombs here because div is null !!
}
What did I do wrong here ?
--------------
I have this mapping:
<hibernate-mapping default-cascade="none">
<class name="com.accovia.domain.Grille" table="grille" polymorphism="implicit" mutable="true">
<id column="grille_id" name="id" type="long" unsaved-value="any">
<generator class="native" />
</id>
<property column="description_grille" length="30" name="descriptionGrille" type="string" unique="false" not-null="true" />
<property column="libelle_prix" length="30" name="libellePrix" type="string" unique="false" not-null="false" />
<list name="divisionList" table="divisions" inverse="false" lazy="false">
<key column="grille_id"/>
<index column="division"/>
<one-to-many class="com.accovia.domain.Divisions"/>
</list>
</class>
</hibernate-mapping>
------------------------
thanks in advance.
thanh.
|