I'm not sure I completely understand your question, but I think what you might be looking for is the "merge" method of the hibernate Session interface - from the api docs:
<snip>
Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance does not become associated with the session. This operation cascades to associated instances if the association is mapped with cascade="merge".

The semantics of this method are defined by JSR-220.
</snip>
 
 
----- Original Message -----
Sent: Thursday, May 04, 2006 9:49 AM
Subject: [CTJUG Forum] Hibernate guru's

Is it possible to clone and persist an object graph in Hibernate?

I’ve come across the org.hibernate.util.SerializationHelper which can be used to clone an object graph, but I don’t think that it can be persisted, since its id’s will be the same as the original object graph.

 

Any ideas?

 

Enrico Goosen

Software Developer

SAICOM TECHNOLOGY

TEL:       +2721 417 1375

FAX:     +2721 417 1361

CEL:     +2783 305 5676

EMAIL: [EMAIL PROTECTED]

 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CTJUG Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
-~----------~----~----~----~------~----~------~--~---

Reply via email to