com.atlassian.confluence.core.persistence.hibernate
Class CompositeInterceptor

java.lang.Object
  extended by com.atlassian.confluence.core.persistence.hibernate.CompositeInterceptor
All Implemented Interfaces:
net.sf.hibernate.Interceptor

public class CompositeInterceptor
extends Object
implements net.sf.hibernate.Interceptor

Hibernate interceptor that allows the chaining of multiple sub-interceptors. Because this is going to be called a _lot_, it's coded for speed over use of pretty idiomatic Java collections. For interceptors that can not be logically chained (isUnsaved, findDirty, instantiate) the first in the chain to provide a non-null answer wins.


Constructor Summary
CompositeInterceptor(List<net.sf.hibernate.Interceptor> delegates)
           
 
Method Summary
 int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, net.sf.hibernate.type.Type[] types)
           
 Object instantiate(Class clazz, Serializable id)
           
 Boolean isUnsaved(Object entity)
           
 void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, net.sf.hibernate.type.Type[] types)
           
 boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, net.sf.hibernate.type.Type[] types)
           
 boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, net.sf.hibernate.type.Type[] types)
           
 boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, net.sf.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
 

Constructor Detail

CompositeInterceptor

public CompositeInterceptor(List<net.sf.hibernate.Interceptor> delegates)
Method Detail

onLoad

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

onFlushDirty

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

onSave

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

onDelete

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

preFlush

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

postFlush

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

isUnsaved

public Boolean isUnsaved(Object entity)
Specified by:
isUnsaved in interface net.sf.hibernate.Interceptor

findDirty

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

instantiate

public Object instantiate(Class clazz,
                          Serializable id)
                   throws net.sf.hibernate.CallbackException
Specified by:
instantiate in interface net.sf.hibernate.Interceptor
Throws:
net.sf.hibernate.CallbackException


Copyright © 2003-2012 Atlassian. All Rights Reserved.