org.squashtest.csp.tm.internal.infrastructure.hibernate
Class AuditLogInterceptor

java.lang.Object
  extended by org.hibernate.EmptyInterceptor
      extended by org.squashtest.csp.tm.internal.infrastructure.hibernate.AuditLogInterceptor
All Implemented Interfaces:
Serializable, org.hibernate.Interceptor

@Component(value="squashtest.tm.persistence.hibernate.AuditLogInterceptor")
public class AuditLogInterceptor
extends org.hibernate.EmptyInterceptor

This interceptor transparently logs creation / last modification data of any Auditable entity.

Author:
Gregory Fouquet
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.EmptyInterceptor
INSTANCE
 
Constructor Summary
AuditLogInterceptor()
           
 
Method Summary
 boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
           
 
Methods inherited from class org.hibernate.EmptyInterceptor
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onLoad, onPrepareStatement, postFlush, preFlush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditLogInterceptor

public AuditLogInterceptor()
Method Detail

onFlushDirty

public boolean onFlushDirty(Object entity,
                            Serializable id,
                            Object[] currentState,
                            Object[] previousState,
                            String[] propertyNames,
                            org.hibernate.type.Type[] types)
Specified by:
onFlushDirty in interface org.hibernate.Interceptor
Overrides:
onFlushDirty in class org.hibernate.EmptyInterceptor

onSave

public boolean onSave(Object entity,
                      Serializable id,
                      Object[] state,
                      String[] propertyNames,
                      org.hibernate.type.Type[] types)
Specified by:
onSave in interface org.hibernate.Interceptor
Overrides:
onSave in class org.hibernate.EmptyInterceptor


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.