Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.1.2
Mapping documents:
<class
name="com.orange.greco.persistance.dao.masque.bean.MasqueTO"
table="MASQUE"
>
...
...
...
<set
name="masquesChamps"
table="MASQUECHAMP"
lazy="true"
cascade="all"
>
<key>
<column name="ID_MASQUE" />
</key>
<composite-element class="com.orange.greco.persistance.dao.masque.bean.MasqueChampsTO">
<property name="rangChampsAffiche" type="java.lang.Integer" column="RANG"/>
<many-to-one name="champ" column="ID_CHAMPAFFICHE" class="com.orange.greco.persistance.dao.references.bean.ChampsAfficheTO"/>
</composite-element>
</set>
...
...
...
</class>
Hibernate keeps inserting and deleting composite-element linked to the MasqueTO class whenever I iterate through the corresponding link event if the linked objects are not modified.
Here is what I get into the Hibernate log :
...
( a lot of )
Hibernate: delete from MASQUECHAMP where ID_MASQUE=? and RANG=? and ID_CHAMPAFFICHE=?
Hibernate: insert into MASQUECHAMP (ID_MASQUE, RANG, ID_CHAMPAFFICHE) values (?, ?, ?)
...
This is performance killing for my application as I keep reading MasqueTO Object and browsing through MasqueChamp link
I guess my mapping is wrong but I can't find out where .
Than you by advance for your help.
Yann