-->
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: Clone of persistent objects
PostPosted: Mon Jan 19, 2004 1:39 pm 
Newbie

Joined: Mon Oct 20, 2003 1:20 pm
Posts: 3
Hello,

I have an application that uses disconnected sessions (using the saveOrUpdate option).

A while ago I implemented a 'clone'-option for business entities which worked by simply finding an existing entity and setting the id to null. The next saveOrUpdate would re-create the entity and duplicate all components

ex. Before clone:
Entity A linked to Foreign Entity X (using a map/list/...)

After clone + save:
Entity A linked to Foreign Entity X
Entity B linked to Foreign Entity X
(the db would hold both entities + 2 records in the link-table)

This worked fine since ever since 2.0 beta 1 up-to 2.1 beta 4. However, today I upgraded to 2.1.1 and this behaviour changed:

ex. Before clone:
Entity A linked to Foreign Entity X (using a map/list/...)

After a save, the db now holds both entities + only 1 record in the link-table
Entity A (which is no longer linked to Foreign Entity X)
Entity B linked to Foreign Entity X
(the db contains both entities + only 1 record in the link-table)

Is this expected behaviour? If so, is there a way to duplicate the old behaviour without implementing a manual deep clone of all objects?

Thanks in advance,
Ive


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 2:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Doesn't sound quite right. Perhaps you should submit a test case to JIRA.


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.