Hibernate version: 3.1.3
Hi,
I have an object A with x , y , z has a key
Code:
<composite-id name="id" class="AID">
<key-property name="p" column name="p" type="integer">
<key-property name="x" column name="x" type="integer">
<key-property name="y" column name="y" type="integer">
<key-property name="z" column name="z" type="integer">
</composite-id>
and an object B with x,y,z,s, t, u
Code:
<composite-id name="id" class="BID">
<key-property name="x" column name="x" type="integer">
<key-property name="y" column name="y" type="integer">
<key-property name="z" column name="z" type="integer">
<key-property name="s" column name="s" type="integer">
<key-property name="t" column name="t" type="integer">
</composite-id>
Ojbect A has a mapping many-to-one with B
Code:
<many-to-one name="relationB" insert="false" update="false" class="B" not-found="ignore" optimistic-lock="false">
<column name="x"/>
<column name="y"/>
<column name="z"/>
<formula>0</formula>
<formula>0</formula>
</many-to-one>
In my case, B can have a liste of A, then I tried to implement a bag with
a key-property ref like this:
Code:
<properties name="lienA">
<property name="xLink" column="x" update="false" insert="false"/>
<property name="yLink" column="y" update="false" insert="false"/>
<property name="zLink" column="z" update="false" insert="false"/>
</properties>
<bag name="listA" inverse="true">
<key property-ref="lienA">
<column name="x"/>
<column name="y" />
<column name="z"/>
</key>
<one-to-many class="AssureCouvert"/>
</bag>
When I tried to initialize my list with
Code:
getHibernateTemplate().initialize(b.getListA)
I have the following error:
Code:
IllegalArgumentException occurred calling getter of BID.x
I work on a legacy database that why I have those mapping.
Is there another way to map my list or I did something wrong in my mapping??
Thanks
Yves Lavoie