Hi,
I was looking for a solution that is able to transparently perform technical historization. Technical historization differs from an auditing solution like Envers - technical historization shall give the user transparent access to entities and their relations to any point of time in the past. For example: read the state of database as it was at June, 15th 8:26pm.
"Transparently" means that the user does not need any special API to perform DML operations via HQL, Criteria-API, Session and EntityManager interfaces. Another requirement is that the entity "designer" can decide whether both current and historic data shall be in a single table or whether current and historic information shall be persistet in two different tables. Effort for the entity "designer" shall be limited to add some (few!) annotations to entities and maybe relations.
I evaluated Envers for this issue but it does not support transparent access to audited entities. Even though Envers cannot provide both a single and dual table solution, because it is a pure auditing tool.
Since I did not find any working solution that fulfills our requirements I started coding our own solution which basically replaces (extension was not always possible) the Hibernate persisters. As of today we are still coding the stuff - but 80% works fine. This means that we are able to insert/update/delete/fetch/query data - even across entities that have different historization preference (not-historized, historized using a single table, historized using two separate tables).
In order to let the community share our code and to avoid additional effort due to future api changes we are thinking about making the project open source. If this is not desired we would at least be happy if certain internal hibernate classes could be modified slightly - starting with less restrictive modifiers - which could avoid copy paste code that we had do do in order to integrate out additional features. We would of course help to to integrate and harmonize the code. We have coded our integration using Hibernate 4.1.7.
What do you think?
Robert
|