org.hibernate.shards.util
Class InterceptorDecorator

java.lang.Object
  extended by org.hibernate.shards.util.InterceptorDecorator
All Implemented Interfaces:
org.hibernate.Interceptor

public class InterceptorDecorator
extends Object
implements org.hibernate.Interceptor

Interceptor implementation that delegates all calls to an inner Interceptor.

Author:
maxr@google.com (Max Ross)

Field Summary
protected  org.hibernate.Interceptor delegate
           
 
Constructor Summary
InterceptorDecorator(org.hibernate.Interceptor delegate)
           
 
Method Summary
 void afterTransactionBegin(org.hibernate.Transaction tx)
           
 void afterTransactionCompletion(org.hibernate.Transaction tx)
           
 void beforeTransactionCompletion(org.hibernate.Transaction tx)
           
 int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)
           
 org.hibernate.Interceptor getDelegate()
           
 Object getEntity(String entityName, Serializable id)
           
 String getEntityName(Object object)
           
 Object instantiate(String entityName, org.hibernate.EntityMode entityMode, Serializable id)
           
 Boolean isTransient(Object entity)
           
 void onCollectionRecreate(Object collection, Serializable key)
           
 void onCollectionRemove(Object collection, Serializable key)
           
 void onCollectionUpdate(Object collection, Serializable key)
           
 void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
           
 String onPrepareStatement(String sql)
           
 boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
           
 void postFlush(Iterator entities)
           
 void preFlush(Iterator entities)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected final org.hibernate.Interceptor delegate
Constructor Detail

InterceptorDecorator

public InterceptorDecorator(org.hibernate.Interceptor delegate)
Method Detail

onLoad

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

onFlushDirty

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

onSave

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

onDelete

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

onCollectionRecreate

public void onCollectionRecreate(Object collection,
                                 Serializable key)
                          throws org.hibernate.CallbackException
Specified by:
onCollectionRecreate in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onCollectionRemove

public void onCollectionRemove(Object collection,
                               Serializable key)
                        throws org.hibernate.CallbackException
Specified by:
onCollectionRemove in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

onCollectionUpdate

public void onCollectionUpdate(Object collection,
                               Serializable key)
                        throws org.hibernate.CallbackException
Specified by:
onCollectionUpdate in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

preFlush

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

postFlush

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

isTransient

public Boolean isTransient(Object entity)
Specified by:
isTransient in interface org.hibernate.Interceptor

findDirty

public int[] findDirty(Object entity,
                       Serializable id,
                       Object[] currentState,
                       Object[] previousState,
                       String[] propertyNames,
                       org.hibernate.type.Type[] types)
Specified by:
findDirty in interface org.hibernate.Interceptor

instantiate

public Object instantiate(String entityName,
                          org.hibernate.EntityMode entityMode,
                          Serializable id)
                   throws org.hibernate.CallbackException
Specified by:
instantiate in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

getEntityName

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

getEntity

public Object getEntity(String entityName,
                        Serializable id)
                 throws org.hibernate.CallbackException
Specified by:
getEntity in interface org.hibernate.Interceptor
Throws:
org.hibernate.CallbackException

afterTransactionBegin

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

beforeTransactionCompletion

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

afterTransactionCompletion

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

onPrepareStatement

public String onPrepareStatement(String sql)
Specified by:
onPrepareStatement in interface org.hibernate.Interceptor

getDelegate

public org.hibernate.Interceptor getDelegate()