Class CompositeInterceptor
- java.lang.Object
-
- com.atlassian.confluence.core.persistence.hibernate.CompositeInterceptor
-
- All Implemented Interfaces:
org.hibernate.Interceptor
public class CompositeInterceptor extends Object implements org.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
Constructors Constructor Description CompositeInterceptor(List<org.hibernate.Interceptor> delegates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterTransactionBegin(org.hibernate.Transaction tx)voidafterTransactionCompletion(org.hibernate.Transaction tx)voidbeforeTransactionCompletion(org.hibernate.Transaction tx)int[]findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)ObjectgetEntity(String entityName, Serializable id)StringgetEntityName(Object object)Objectinstantiate(String entityName, org.hibernate.EntityMode entityMode, Serializable id)BooleanisTransient(Object entity)voidonCollectionRecreate(Object collection, Serializable key)voidonCollectionRemove(Object collection, Serializable key)voidonCollectionUpdate(Object collection, Serializable key)voidonDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)booleanonFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)booleanonLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)StringonPrepareStatement(String sql)booleanonSave(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)voidpostFlush(Iterator entities)voidpreFlush(Iterator entities)
-
-
-
Constructor Detail
-
CompositeInterceptor
public CompositeInterceptor(List<org.hibernate.Interceptor> delegates)
-
-
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:
onLoadin interfaceorg.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:
onFlushDirtyin interfaceorg.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:
onSavein interfaceorg.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:
onDeletein interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
onCollectionRecreate
public void onCollectionRecreate(Object collection, Serializable key) throws org.hibernate.CallbackException
- Specified by:
onCollectionRecreatein interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
onCollectionRemove
public void onCollectionRemove(Object collection, Serializable key) throws org.hibernate.CallbackException
- Specified by:
onCollectionRemovein interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
onCollectionUpdate
public void onCollectionUpdate(Object collection, Serializable key) throws org.hibernate.CallbackException
- Specified by:
onCollectionUpdatein interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
preFlush
public void preFlush(Iterator entities) throws org.hibernate.CallbackException
- Specified by:
preFlushin interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
postFlush
public void postFlush(Iterator entities) throws org.hibernate.CallbackException
- Specified by:
postFlushin interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
isTransient
public Boolean isTransient(Object entity)
- Specified by:
isTransientin interfaceorg.hibernate.Interceptor
-
findDirty
public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)
- Specified by:
findDirtyin interfaceorg.hibernate.Interceptor
-
instantiate
public Object instantiate(String entityName, org.hibernate.EntityMode entityMode, Serializable id) throws org.hibernate.CallbackException
- Specified by:
instantiatein interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
getEntityName
public String getEntityName(Object object) throws org.hibernate.CallbackException
- Specified by:
getEntityNamein interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
getEntity
public Object getEntity(String entityName, Serializable id) throws org.hibernate.CallbackException
- Specified by:
getEntityin interfaceorg.hibernate.Interceptor- Throws:
org.hibernate.CallbackException
-
afterTransactionBegin
public void afterTransactionBegin(org.hibernate.Transaction tx)
- Specified by:
afterTransactionBeginin interfaceorg.hibernate.Interceptor
-
beforeTransactionCompletion
public void beforeTransactionCompletion(org.hibernate.Transaction tx)
- Specified by:
beforeTransactionCompletionin interfaceorg.hibernate.Interceptor
-
afterTransactionCompletion
public void afterTransactionCompletion(org.hibernate.Transaction tx)
- Specified by:
afterTransactionCompletionin interfaceorg.hibernate.Interceptor
-
-