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: Cloning objects with lists
PostPosted: Sat Jul 30, 2005 5:30 am 
Newbie

Joined: Sat Jul 30, 2005 5:18 am
Posts: 6
Hi.

I have a ClassA and it has a bag of ClassBs and this one has a bag of ClassCs.

I want copy and the object of a ClassA with one or two properties changed with all the lists below but I don't want to go trough the lists and copy every level one by one. Is there an easy way to do this?


Any suggestion would help.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 30, 2005 5:53 am 
Beginner
Beginner

Joined: Wed May 04, 2005 5:17 am
Posts: 40
Unfortunately there is no easy way to do this. Basically implementing clone() and calling super.clone will give you back a fully populated object (exception for objects marked as transient).

You must then remove all hibernate properties ;)

HTH.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.