Hi all,
I try to load a set defined as a one-to-many relationship between two pajos ending up in an infinite loop as it seems when I make it run.
The logs don't give anything.
Here is the configuration :
<hibernate-mapping>
<class name="gouv.education.gestionAnnuaireInternat.hibernate.generation.ValeurTypologie" table="VALEUR_TYPOLOGIE" schema="DB2INST4">
<id name="oid" type="java.lang.Integer">
<column name="OID" />
<generator class="sequence">
<param name="sequence">val_typo_oid_sequence</param>
</generator>
</id>
<many-to-one name="typologie" class="gouv.education.gestionAnnuaireInternat.hibernate.generation.Typologie" fetch="select">
<column name="OID_TYPO" not-null="true" />
</many-to-one>
<property name="ordre" type="java.lang.Integer">
<column name="ORDRE" />
</property>
<property name="libelle" type="java.lang.String">
<column name="LIBELLE" length="200" not-null="true" />
</property>
<property name="libelleNomen" type="java.lang.String">
<column name="LIBELLE_NOMEN" length="200" />
</property>
</class>
</hibernate-mapping>
-------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="gouv.education.gestionAnnuaireInternat.hibernate.generation.Typologie" table="TYPOLOGIE" schema="DB2INST4">
<id name="oid" type="java.lang.Integer">
<column name="OID" />
<generator class="sequence">
<param name="sequence">typo_oid_sequence</param>
</generator>
</id>
<property name="nom" type="java.lang.String">
<column name="NOM" length="100" not-null="true" />
</property>
<set name="valeurTypologies" inverse="true">
<key>
<column name="OID_TYPO" not-null="true" />
</key>
<one-to-many class="gouv.education.gestionAnnuaireInternat.hibernate.generation.ValeurTypologie" />
</set>
</class>
</hibernate-mapping>
-----------------------------------------------------
I try to get the set from the typologie POJO from those lines :
public List getValTypoForTypo(String typologie)
{
List typoList = typologieDAO.findByNom(typologie);
if(typoList.size()==0)
return typoList;
Set set= ((Typologie)(typoList.get(0))).getValeurTypologies();
List list = new ArrayList(set);
return list;
}
-------------------------------------------------------
My environment is Spring 2.0, Hibernate 3.0 Struts 1.2, and the session is opened at the filter level as someone advices elsewhere whith no more luck.
Can anybody help me ?
Thanks.
|