-->
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.  [ 2 posts ] 
Author Message
 Post subject: @OneToOne bidirectional relationship after detaching
PostPosted: Tue Oct 28, 2008 10:35 pm 
Newbie

Joined: Tue Oct 28, 2008 8:51 pm
Posts: 2
Hi,

I have the following relationship defined for 2 classes.

Student -> Account and Account -> Student.

When I load the student and detach the object for editing in a jsp, the account is set too LAZY loading. After I edit the Student and save it, because the Student object no longer have a reference to Account, it removes the relationship.

Can someone please tell me how to avoid this?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 02, 2008 5:44 pm 
Newbie

Joined: Sat Oct 18, 2008 11:34 am
Posts: 10
You should use merge() to save the edited Student object and be careful no change the Account field.

Also, I recommend you to read this short, but enligtening article about different persisting methods.


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

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.