Joined: Mon Oct 03, 2005 1:42 pm Posts: 2
|
Hibernate version:
2.0
Full stack trace of any exception that occurs:
org.hibernate.MappingException: Error reading resource: fr/jet/contacteur/client/stats/dao/hibernate/CampagneStats.hbm.xml
Name and version of the database you are using:
mysql 4.1
I want to map my table CampagneStats to my composite-key table CampagneStatsCumulTime by a Map, using "time_limit" which is part of the primary key as my map-key.
My mapping of CampagneStatsCumulTime :
...
<class name="CampagneStatsCumulTime" table="campagne_stats_cTime">
<composite-id >
<key-many-to-one name="campagne" class="CampagneStats" column="ref_campagne" />
<key-property name="nLimit" type="string" column="time_limit"/>
</composite-id>
...
And CampagneStats
<class name="CampagneStats" table="campagne_stats">
<id name="reference" column="ref_campagne">
<generator class="foreign">
<param name="property">campagne</param>
</generator>
</id>
<map name="CumulTimes" inverse="true" cascade="all-delete-orphan">
<key>
<column name="ref_campagne" not-null="true"/>
<column name="time_limit"/>
</key>
<one-to-many class="CampagneStatsCumulTime"/>
</map>
What is wrong here? I also tried :
<map name="CumulTimes" inverse="true" cascade="all-delete-orphan">
<key>
<column name="ref_campagne" not-null="true"/>
</key>
<map-key column="time_limit"/>
<one-to-many class="CampagneStatsCumulTime"/>
</map>
with no more luck. However if i use Set instead of map in the first example it works fine.
|
|