-->
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: Parent Child question
PostPosted: Sun Mar 23, 2008 10:58 pm 
Newbie

Joined: Thu Sep 13, 2007 2:45 pm
Posts: 10
I have a parent p1 associated with a set of children (c11,c12,c13...).
I have another parent p2 associated with another set of children (c21,c22,c23...)

All the above are persisted instances.

What is the best approach to swap parents?

I want to do something like p1 associated to c21,c22,c23 and p2 associated to c11,c12,c13.

I have the following Parent/Child class.

class Parent {

private Set<Child> children;

}

class Child {
private Parent parent;

}


Can anyone help me with a piece of code snippet to do the swapping?


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.