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