Consider the following entities and their relationship: EntityA -> EntityB -> EntityC where "->" means reference to.
Now, EntityA and EntityC are configured to be @Audited but EntityB is not.
When I load a historic state of EntityA via the AuditReader, the historic instance of EntityA has a reference to EntityB in its current state (because EntityB is not audited). However, this EntityB references EntityC in its current state and not in the state as it was at the revision of the loaded EntityA.
So my idea is, that envers should support a "timemachine" mode, where I specify a revision and all entities are resolved at that revision. For not audited entities (like EntityB in the example), the current state is taken, but references from not audited entities to audited entities are set to the correct revision.
Has anyone considered a similar usecase and maybe tried to implement such a feature? Any other thoughts for such a feature, good or bad? Can anyone give directions how to implement such a feature?
Thanks, Felix
|