-->
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.  [ 4 posts ] 
Author Message
 Post subject: Bidirectional delete & Second-level cache
PostPosted: Wed Jun 23, 2004 5:14 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
I've read the documentation and the forum. And it seems that if you have a bidirectional relationship. You have to delete the object on both sides of the relationship.

The problem with this is that I'm using the second-level cache and I have the following relationship Parent->Children & Child->Parent (one-to-many & many-to-one)

The problem comes when the second-level cache contains the parent and the associated collection of children.

If I want to delete a child object I first have to remove it from the parent by calling parent.getChildren().remove(). The problem is that I only have the primary key of the child. So to get the parent I have to first load the child and then call child.getParent().getChildren().remove(child).

Can someone verify this. I'm quite sure this is the case.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 24, 2004 11:59 am 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
Can someone please verify the above.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 24, 2004 12:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
sure.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 24, 2004 12:36 pm 
Beginner
Beginner

Joined: Fri Jan 23, 2004 4:29 pm
Posts: 39
gavin wrote:
sure.

Danke sch


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.