Hibernate versioning: Version as part of composite key
posted 5 years ago
I've a few existing tables which have an id and version as PK.
This is mainly to keep track of all the updates.
Following are the problems I faced:
1. version can't be a part of composite-id.
2. if version is outside the composite-id, its not part of the PK and will not let me insert another version (due to PK violation).
3. envers wasn't helpful as it creates a seperate AUD table wheras I want the versioning in the same table.
Any ideas/suggestions would be greatly be appreciated