I am using struts and hibernate. I have a parent and child relation using set in hbm.
In the action I am using session.saveOrUpdate() method to save but while s
So For my case I noticed hibernate is trying to update the record rather than inserting it and that thrown the exception mentioned.
I finally came to find that my entity had an updatedAt timestamp column:
and when I was trying to initialize the object i found that the code was setting this field explicitly.
after removing that setUpdateDate(new Date()) it worked and did an insert instead.