Deep Copy Entity object

Posts   
 
    
GemMaddy
User
Posts: 5
Joined: 01-Jul-2009
# Posted on: 02-Jul-2009 07:34:27   

Hi,

I've a Entity class named as "Quote". It has relations to several other entity classes and they further have their own relations. I need to make a copy of the all the related records. In simple words, I need to create a duplicate record with new Identity in database.

Can someone suggest me the best way to do so?

Regards Manish

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 02-Jul-2009 09:46:22   

This has been discussed several time, please search the forum for: deep copy

rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 02-Jul-2009 17:36:13   

Hi Manish -

You can clone each Entity you need manually. Do a search on the forums for the word "Clone". But you'll need to manually do this cloning on every Entity, for every one of your copy scenarios.

Many of my apps require this copy functionality. Because of this - I have implemented RecursiveCloneAsNew(), which will automatically clone an Entity & all its related Children n-Levels deep, while also maintaining references to its Parents. You can find more information on it within these forums.

Please contact me directly if it's something that would benefit you. Take care!

Ryan

ryan [.] hatch [sign] konect [.] com