So the entry was removed from the ordinal 1 and added with ordinal 0. That seems correct.
Was the constraint that was violated created automatically? Or did you create it yourself?
Thank you for your reply.
It was mysql database refused the change, some error like:
SQL Error: 1062, SQLState: 23000
Duplicate entry '1305063-1088737-14201' for key 1
I was confused about the operation on this ordinal update, do you mean the hibernate will remove the old record and generate a new one with the same id?
If that's the case, can I update the table with composite primary key: REV, account_holder_id, id, REVTYPE? Currently it's REV, account_holder_id, id and gives me error.
Will it cause any other issue? Because I've never put REVTYPE column as part of primary key in any of my audit tables.
Thank you very much.
The generated schema should have the correct constraints - did you auto-generate the schama, or do it by hand? I think you should add ordinal, not revtype, to your constraint.
I think I should try with auto-generated schema. Thanks very much for the solution.