| Beginner |
 |
Joined: Fri May 11, 2007 11:03 am Posts: 32
|
|
Hi,
The code for my program is:
mapping for A:
<hibernate-mapping package="parms">
<class name="A" table="A" lazy="true" batch-size="20" select-before-update='true' >
<id name="id" column="ID">
<generator class="increment"/>
</id>
<many-to-one name="b" column="Ba_ID" class="B" not-found="ignore"
cascade="none" lazy="false" not-null="false" unique="false"/>
<property name="place" column="PLACE"/>
</class>
mapping for B:
<class name="B" table="B" lazy="true" batch-size="10" select-before-update="true">
<cache usage="read-write"/>
<id name="id" column="B_ID" >
<generator class="assigned"/>
</id>
<property name="programId" column="GROUP_ID" unique="true"/>
</class>
Now the only difference from a normal condition is that not all the rows in table A have non-null value for the column Ba_ID. That means some of rows have null values for column Ba_ID.
Now retrieval of these rows which have null values for column Ba_ID works fine. And it retrieves a null relationship between the tables for these rows. Now when I try to update column PLACE. It tries to update column Ba_ID also and there it throws me TransientOBjectException.
But I dont want to change anything for that column.
Last edited by sriguru on Mon May 14, 2007 3:34 pm, edited 1 time in total.
|
|