I have this .hbm.xml file :
Evenement.hbm.xml :
<hibernate-mapping package="com.af.evenement">
<class name="Evenement" table="TB_EVENEMENT">
<id name="id" type="string" column="CODE_EVENEMENT">
<generator class="assigned" />
</id>
<set name="causesAnnexes">
<key column="CODE_EVENEMENT" />
<one-to-many class="CausesAnnexesEvt" />
</set>
........
and I've got this other .hbm.xml file : CausesAnnexesEvt :
<class name="CausesAnnexesEvt" table="TB_CAUSESANNEXES_EVT">
<composite-id name="id" class="CausesAnnexesEvtPK">
<key-many-to-one
class="Evenement"
column="CODE_EVENEMENT"
name="Evenement"
/>
<key-many-to-one
class="Cause"
column="CODE_CAUSE"
name=cause"
/>
</composite-id>
</class>
when I try to delete an Evenement object with this line of code :
Session s=getCurrentSession();
tx=s.beginTransaction();
s.delete(evenement);
s.flush();
s.clear();
when I run the above code, I get the following exception :
QueryException : could not resolve property : causesAnnexesEvt.