-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem Updating a row!!
PostPosted: Fri May 11, 2007 11:35 am 
Beginner
Beginner

Joined: Fri May 11, 2007 11:03 am
Posts: 32
Hi,
Im getting weird error.
I have a many-to-one relationship(unidirectional) between two classes(say A-B).
Now when I try to retrieve records from the many side I can retrieve the records with no problem.
One more thing to be mentioned here is that its 1-0 relationship. that means,
for a particular row in A there might be 0 or 1 row in B.
Also I have set cascading property as "none" in A.
Now when I try to update the row which I retrieved from A(one which had retireved null value for B) it tries to update the null value. and throws me a transient Object Exception.
Why should It even try to update the child table(B) when cascading has been set to none.
the mapping s are :
for class A:

<class name="A" table="A" lazy="false" batch-size="20" select-before-update='true' dynamic-update='true' >
<id name="id" column="ID">
<generator class="increment"/>
</id>
<many-to-one name="b_id" column="bid" class="B" not-found='ignore'
cascade="none" lazy="false" not-null="false" unique="false" />
</class>

for class 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="progd" column="GROUPD" unique="true"/>
</class>

I fail to understand the reason......


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.