com.melloware.jukes.db.audit
Class AuditInterceptor

java.lang.Object
  extended by com.melloware.jukes.db.audit.AuditInterceptor
All Implemented Interfaces:
java.io.Serializable, org.hibernate.Interceptor

public class AuditInterceptor
extends java.lang.Object
implements org.hibernate.Interceptor, java.io.Serializable

Audit inteceptor so any Hibernate insert or update will update the CREATED_USER and MODIFIED_USER as well as CREATED_DATE on inserts.

Copyright (c) 1999-2007 Melloware, Inc.

Version:
4.0
Author:
Emil A. Lefkof III
See Also:
Auditable, Serialized Form

Constructor Summary
AuditInterceptor()
          Default constructor
 
Method Summary
 void afterTransactionBegin(org.hibernate.Transaction arg0)
           
 void afterTransactionCompletion(org.hibernate.Transaction arg0)
           
 void beforeTransactionCompletion(org.hibernate.Transaction arg0)
           
 int[] findDirty(java.lang.Object arg0, java.io.Serializable arg1, java.lang.Object[] arg2, java.lang.Object[] arg3, java.lang.String[] arg4, org.hibernate.type.Type[] arg5)
           
 java.lang.Object getEntity(java.lang.String arg0, java.io.Serializable arg1)
           
 java.lang.String getEntityName(java.lang.Object arg0)
           
 java.lang.Object instantiate(java.lang.String arg0, org.hibernate.EntityMode arg1, java.io.Serializable arg2)
           
 java.lang.Boolean isTransient(java.lang.Object arg0)
           
 void onCollectionRecreate(java.lang.Object arg0, java.io.Serializable arg1)
           
 void onCollectionRemove(java.lang.Object arg0, java.io.Serializable arg1)
           
 void onCollectionUpdate(java.lang.Object arg0, java.io.Serializable arg1)
           
 void onDelete(java.lang.Object arg0, java.io.Serializable arg1, java.lang.Object[] arg2, java.lang.String[] arg3, org.hibernate.type.Type[] arg4)
           
 boolean onFlushDirty(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] currentState, java.lang.Object[] previousState, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onLoad(java.lang.Object arg0, java.io.Serializable arg1, java.lang.Object[] arg2, java.lang.String[] arg3, org.hibernate.type.Type[] arg4)
           
 java.lang.String onPrepareStatement(java.lang.String arg0)
           
 boolean onSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
           
 void postFlush(java.util.Iterator arg0)
           
 void preFlush(java.util.Iterator arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditInterceptor

public AuditInterceptor()
Default constructor

Method Detail

getEntity

public java.lang.Object getEntity(java.lang.String arg0,
                                  java.io.Serializable arg1)
                           throws org.hibernate.CallbackException
Specified by:
getEntity in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

getEntityName

public java.lang.String getEntityName(java.lang.Object arg0)
                               throws org.hibernate.CallbackException
Specified by:
getEntityName in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

isTransient

public java.lang.Boolean isTransient(java.lang.Object arg0)
Specified by:
isTransient in interface org.hibernate.Interceptor

afterTransactionBegin

public void afterTransactionBegin(org.hibernate.Transaction arg0)
Specified by:
afterTransactionBegin in interface org.hibernate.Interceptor

afterTransactionCompletion

public void afterTransactionCompletion(org.hibernate.Transaction arg0)
Specified by:
afterTransactionCompletion in interface org.hibernate.Interceptor

beforeTransactionCompletion

public void beforeTransactionCompletion(org.hibernate.Transaction arg0)
Specified by:
beforeTransactionCompletion in interface org.hibernate.Interceptor

findDirty

public int[] findDirty(java.lang.Object arg0,
                       java.io.Serializable arg1,
                       java.lang.Object[] arg2,
                       java.lang.Object[] arg3,
                       java.lang.String[] arg4,
                       org.hibernate.type.Type[] arg5)
Specified by:
findDirty in interface org.hibernate.Interceptor

instantiate

public java.lang.Object instantiate(java.lang.String arg0,
                                    org.hibernate.EntityMode arg1,
                                    java.io.Serializable arg2)
                             throws org.hibernate.CallbackException
Specified by:
instantiate in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onCollectionRecreate

public void onCollectionRecreate(java.lang.Object arg0,
                                 java.io.Serializable arg1)
                          throws org.hibernate.CallbackException
Specified by:
onCollectionRecreate in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onCollectionRemove

public void onCollectionRemove(java.lang.Object arg0,
                               java.io.Serializable arg1)
                        throws org.hibernate.CallbackException
Specified by:
onCollectionRemove in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onCollectionUpdate

public void onCollectionUpdate(java.lang.Object arg0,
                               java.io.Serializable arg1)
                        throws org.hibernate.CallbackException
Specified by:
onCollectionUpdate in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onDelete

public void onDelete(java.lang.Object arg0,
                     java.io.Serializable arg1,
                     java.lang.Object[] arg2,
                     java.lang.String[] arg3,
                     org.hibernate.type.Type[] arg4)
              throws org.hibernate.CallbackException
Specified by:
onDelete in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onFlushDirty

public boolean onFlushDirty(java.lang.Object entity,
                            java.io.Serializable id,
                            java.lang.Object[] currentState,
                            java.lang.Object[] previousState,
                            java.lang.String[] propertyNames,
                            org.hibernate.type.Type[] types)
                     throws org.hibernate.CallbackException
Specified by:
onFlushDirty in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onLoad

public boolean onLoad(java.lang.Object arg0,
                      java.io.Serializable arg1,
                      java.lang.Object[] arg2,
                      java.lang.String[] arg3,
                      org.hibernate.type.Type[] arg4)
               throws org.hibernate.CallbackException
Specified by:
onLoad in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onPrepareStatement

public java.lang.String onPrepareStatement(java.lang.String arg0)
Specified by:
onPrepareStatement in interface org.hibernate.Interceptor

onSave

public boolean onSave(java.lang.Object entity,
                      java.io.Serializable id,
                      java.lang.Object[] state,
                      java.lang.String[] propertyNames,
                      org.hibernate.type.Type[] types)
               throws org.hibernate.CallbackException
Specified by:
onSave in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

postFlush

public void postFlush(java.util.Iterator arg0)
               throws org.hibernate.CallbackException
Specified by:
postFlush in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

preFlush

public void preFlush(java.util.Iterator arg0)
              throws org.hibernate.CallbackException
Specified by:
preFlush in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException


Copyright © 1999-2008 Melloware Inc. All Rights Reserved.