Hi,
I work with Spring/Hibernate Dao's for saving my Object in the Database. Now I had to backup all my DB inside my application. Now when I try to read my backup back, my application crashed. Now I found the problem for this crashing. It's Hibernate it creates automaticly a new ID for my Object when I want to save.
For example I saved my object a with an Id 4 in my backup file.
Now i read the backup file. Clean my DB from old stuff. Save this object back to db. and now my object id is for example 5. But it has to be 4. How can I prevent hybernate from auto generate my id value?
Should i write an extra JDBCDao for importing ?
Here is my Model attribute for id
@ID
@Column(name="ID")
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
Thanks for helping and exuse my bad english.