Open erikhofer opened 7 years ago
Hibernate Envers can be used to automatically create the "snapshots" (revisions).
Envers can flag properties as changed but these flags can only be used to filter queries. They can't be easily retrieved and Envers can't generate a diff of those properties.
ChangeSet
s could be built using onFlushDirty()
of a Hibernate interceptor.
As partly discussed in #6 every user should be able to edit entities like products. We thus need a versioning system that
Proposal: Whenever an entity of this kind is updated, a diff is created and saved as a "changeset". Also a snapshot of the old version is saved to the database.
The basic entity structure could look like this (optimistic locking not included):
Considerations: