users@glassfish.java.net

JPA Graph Id Swap?

From: <glassfish_at_javadesktop.org>
Date: Tue, 10 Mar 2009 17:57:05 PDT

I'm not sure if anyone has actually done something like this but theoretically it sounds plausible.

Basically I need to clone an entire object graph for the possibility of edits. These edits can be approved or rejected down the line.
If the edits are rejected the original values are kept in place.
If they are approved the clone becomes the new graph but the original id needs to be the same.

Now, I would need to determine all the difference in a fairly complicated graph for all the updates, additions and deletions when merging the edits

What I was thinking might be possible is if I could perform id updates on the clone replacing that with the original and merge the base entity and allow the cascade to handle the modifications.

Would something like this work or will there be issues with JPA or I should say JPA implementations?
[Message sent by forum member 'davesmith' (davesmith)]

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