10

I have been looking at Hibernate Envers for entity auditing. I'm using EclipseLink but I'd like something similar.

I've seen some implementations that involve creating a SessionCustomizer to handle some of the persistence of auditing data. I'd really like something like Hibernate where I can simply annotate the entity and have the same effect.

Mark Robinson
  • 3,135
  • 1
  • 22
  • 37
  • Is there any other solution today? did any one use Javers / audi4j? would it fit? – a.k May 30 '18 at 15:40

2 Answers2

6

Unfortunately, EclipseLink doesn't have a feature which covers auditing out-of-the-box.

We use a SessionEventListener to intercept a flush or commit and use the calculated changeset for inserting the auditing data into audit tables.

MRalwasser
  • 15,605
  • 15
  • 101
  • 147
2

There is support for auditing of entities in EclipseLink. They call it History.

http://wiki.eclipse.org/EclipseLink/Examples/JPA/History

Ondrej Bozek
  • 10,987
  • 7
  • 54
  • 70
  • History is a good feature. But it cannot work well with batch write. Batch write is disabled after you applied history policy. http://stackoverflow.com/questions/37848686/eclipselink-batch-write-is-disabled-when-use-history-policy-or-descriptoreventad – Jacky Jun 29 '16 at 08:23