I am working on an spring-hibernate-envers application. After lot of googling things are finally working for me but i have still got couple of questions.
Earlier i was using
saveOrUpdatefor saving or updating entities. But when working with envers it was throwing anonUniqueObjectexception. So i usedmergeinstead and it worked. Is it right to use merge for this? Doesmergeinserts new objects to db?I tried following code:
entity=merge(entity); saveOrUpdate(entity);
This also worked. Is it the right way? And also i am curious that why saveOrUpdate is not throwing any error now.