|
Please make it possible to use Envers and ValidityAuditStrategy specifically with existing database containing legacy data and potentially more than one entry point.
Consider the case of a multi-tier application which generally uses Hibernate to access database but not only. As I've learned form https://community.jboss.org/thread/160195:
if a row is added outside of Hibernate/Envers, you have to manually initialize the audit table with an initial revision, type = 0 (ADD)
This sounds perfectly reasonable to me – but is very error-prone and extremely to ensure when data used to be modified manually (i.e. directly in the database) by e.g. customer support staff. Currently, when such a "wrong" modification to the database takes place, application will no longer work, throwing exceptions from Envers like
java.lang.RuntimeException: Cannot find previous revision for entity <entityClassName> and id <id>
Therefore, please make it possible and allowed to use Envers in the case when not necessarily all changes are written in _AUD tables.
|