Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: intercepting changes to mapped collection
PostPosted: Wed Aug 08, 2012 11:29 am 
Newbie

Joined: Tue Feb 08, 2011 10:33 am
Posts: 1
Hi,

I would like to ask you about the correct way of intercepting updates on mapped collections.

We have implemented an automatic auditing based on the following article:
http://www.ideyatech.com/2008/07/audit-logging-via-hibernate-interceptor-12/

This is we are inheritting from org.hibernate.EmptyInterceptor.

We are overriding the method onCollectionUpdate().

We only want to audit the changes on collections, not the whole new state.
The method onCollectionUpdate() only gives us the latest state of the collection.

When onFlushDirty() method of the interceptor is called for the parent entity,
both previousState and currentState parameters also contain only the latest state of the collection.

What is the correct way to find the differences between the previous and the current states of the updated collections?

Many thanks for any tips or hints :)

Regards,
Martin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.