users@glassfish.java.net

Re: jpa and object duplication/cloning

From: <forums_at_java.net>
Date: Fri, 23 Aug 2013 17:46:42 -0500 (CDT)

I SOLVED THIS. I created a component that makes this whole process for you
based on the annotations of the package (javax.persistence). Component
already sets the id of the entity to null. He does all the analysis of the
algorithm to be applied based on the type of each attribute relationship @
OneToMany @ OneToOne or @ ManyToMany. Example Person person =
personDAO.find(1); PersistenceCloner cloner = new PersistenceCloner(person);
Pessoa personCopy = cloner.generateCopyToPersist(); Download JAR and SOURCES:
https://lindbergframework.googlecode.com/files/lindbergframework-cloner-package.rar

--
[Message sent by forum member 'Lindberg713']
View Post: http://forums.java.net/node/673184