Audit « Collection « JPA Q&A





1. Hibernate Audit Trail not generating for dirty collections    forum.hibernate.org

Hi, I have a parent collection say employee and it has a collection of addresses. When i update one address or add a new address the employee object is not getting dirty and the isFlushDirty() of the auditing is not getting invoked and the audit properties are not getting generated. But when i explicitly change a property on employee before auditing, ...

2. best way to audit changes to collections    forum.hibernate.org

when a persistent collection is modified, Hibernate wont call the interceptor method onFlushDirty() unless the entity is versioned or a non-collection property has also been changed. i understand that this is by design but i don't understand the rationale behind the decision. i would happily use versioning if it didnt cripple batch updates. as it stands, i see no clear way ...

3. Audit Logging & Collections    forum.hibernate.org

4. Auditing collection changes    forum.hibernate.org

Well, nobody answered so far, so it I try another way. For my purposes of auditing changes in entities and their relations I implemented a JPA interceptor ("extends EmptyInterceptor") which does it's work onFlushDirty. Hibernate invokes it on an entity and gives it an Object[] currentState and an Object[]previousState. This works nicely for non-collection values. But I also wanted to know ...