users@glassfish.java.net

jpa and object duplication/cloning

From: <glassfish_at_javadesktop.org>
Date: Mon, 07 Jan 2008 07:08:26 PST

Hello.
I have a request where i need to read a JPA object tree from a persistence context (a database on a machine) and persist it to an other (database on an other machine).
Objets i read from first machine have their IDs and when persisting to second machine, they overwrite objects with same IDs.
How can i persist a complete object tree without having to manually and recursively erase all IDs ? Not only it is tedious, but it is sometimes almost impossible to do. I would really love to get a more direct solution.

Thank you.
[Message sent by forum member 'pepe' (pepe)]

http://forums.java.net/jive/thread.jspa?messageID=252501