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

onLoad

public boolean onLoad(java.lang.Object entity,
                      java.io.Serializable id,
                      java.lang.Object[] state,
                      java.lang.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(java.lang.Object entity,
                            java.io.Serializable id,
                            java.lang.Object[] currentState,
                            java.lang.Object[] previousState,
                            java.lang.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(java.lang.Object entity,
                      java.io.Serializable id,
                      java.lang.Object[] state,
                      java.lang.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(java.lang.Object entity,
                     java.io.Serializable id,
                     java.lang.Object[] state,
                     java.lang.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(java.util.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(java.util.Iterator entities)
               throws net.sf.hibernate.CallbackException
Specified by:
postFlush in interface net.sf.hibernate.Interceptor
Throws:
net.sf.hibernate.CallbackException

isUnsaved

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

findDirty

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

instantiate

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


Copyright © 2003-2014 Atlassian. All Rights Reserved.