Search code examples
javaspring-data-jpajavers

Is it possible to change the javers history?


I am working on a rest backend using spring boot/jpa. I also use javers to audit my JpaRespositories.

I am not entirely sure, if javers is intended for this purpose, but in addition to auditing my jpa entities i would also like to be able to edit the history.

For example, i would like to get a Shadow-Object from a certain date:

javers.findShadows(QueryBuilder.byInstanceId("Frodo", Employee.class).withShadowScope(ShadowScope.DEEP_PLUS).from(date).build());

Then i would like to change the returned Shadow-Object and somehow 'write it back' into the history, so that when i execute the above statement again, i would get back the edited version.

Any Ideas if that kind of behaviour is possible?


Solution

  • You can't do it. Javers' Snapshots are immutable by design.