users@glassfish.java.net

Re: jpa and object duplication/cloning

From: <glassfish_at_javadesktop.org>
Date: Wed, 09 Jan 2008 22:43:41 PST

We are not talking about the same thing.

Cloning and deep copy are responsibility of the program, JPA does not have to mess with this. We agree.

Nevertheless, just as JPA handles the merging and persisting of entities by setting IDs, it should also handle erasing of those IDs. JPA does not need to know anything more about my data to erase those IDs than when it sets them. What i'm just wishing is that JPA is able to cleanup its own data. IDs are not part of my domain but his, i live without using or even knowing them (ok, mostly. server might use them but client does not), there are here to satisfy JPA's needs.

Everyone's needs are different and i NEED to be able to pass object trees from a JPA context to an other without erasing what's on second context. I also need to be able to duplicate object trees on same context and JPA has the responsibility (imho) to let me do that but actually it ties me to handcoded and/or dirty solutions.
My case is the one of a set of persons handling configuration data for hundreds of servers (about 400 when at max), all at the same time, eventually taking data from one to an other. Data can be pretty deep and complex object trees, complex enough for me to want JPA to handle its own data.
[Message sent by forum member 'pepe' (pepe)]

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