Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
If I have a detached object named "cat" with an identifier "1" and I want to import it to the database, so I can use session.replicate() to overwrite the existed row in the database with the same ID "1". But I have another requirement that I need to import the object like a new one, that means I must import the object cat with the same content except the identifier "1",
how can I generate the detached object cat's ID automatically,and how can I update the parent's ID stored in the cat's children, I need generate new ID for cat's children too, for the detached object cat is contains not only cat but also cat's children too, I must import all the objects like new ones.
Thank you in advance!
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: