public class EmptyInterceptor extends java.lang.Object implements Interceptor, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static Interceptor |
INSTANCE
The singleton reference.
|
Modifier | Constructor and Description |
---|---|
protected |
EmptyInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
afterTransactionBegin(Transaction tx)
Called when a Hibernate transaction is begun via the Hibernate Transaction
API.
|
void |
afterTransactionCompletion(Transaction tx)
Called after a transaction is committed or rolled back.
|
void |
beforeTransactionCompletion(Transaction tx)
Called before a transaction is committed (but not before rollback).
|
int[] |
findDirty(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] currentState,
java.lang.Object[] previousState,
java.lang.String[] propertyNames,
Type[] types)
Called from flush().
|
java.lang.Object |
getEntity(java.lang.String entityName,
java.io.Serializable id)
Get a fully loaded entity instance that is cached externally.
|
java.lang.String |
getEntityName(java.lang.Object object)
Get the entity name for a persistent or transient instance.
|
java.lang.Object |
instantiate(java.lang.String entityName,
EntityMode entityMode,
java.io.Serializable id)
Instantiate the entity class.
|
java.lang.Boolean |
isTransient(java.lang.Object entity)
Called to distinguish between transient and detached entities.
|
void |
onCollectionRecreate(java.lang.Object collection,
java.io.Serializable key)
Called before a collection is (re)created.
|
void |
onCollectionRemove(java.lang.Object collection,
java.io.Serializable key)
Called before a collection is deleted.
|
void |
onCollectionUpdate(java.lang.Object collection,
java.io.Serializable key)
Called before a collection is updated.
|
void |
onDelete(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
Type[] types)
Called before an object is deleted.
|
boolean |
onFlushDirty(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] currentState,
java.lang.Object[] previousState,
java.lang.String[] propertyNames,
Type[] types)
Called when an object is detected to be dirty, during a flush.
|
boolean |
onLoad(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
Type[] types)
Called just before an object is initialized.
|
java.lang.String |
onPrepareStatement(java.lang.String sql)
Called when sql string is being prepared.
|
boolean |
onSave(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
Type[] types)
Called before an object is saved.
|
void |
postFlush(java.util.Iterator entities)
Called after a flush that actually ends in execution of the SQL statements required to synchronize
in-memory state with the database.
|
void |
preFlush(java.util.Iterator entities)
Called before a flush.
|
public static final Interceptor INSTANCE
public void onDelete(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, Type[] types)
Interceptor
onDelete
in interface Interceptor
entity
- The entity instance being deletedid
- The identifier of the entitystate
- The state of the entitypropertyNames
- The names of the entity properties.types
- The types of the entity propertiespublic boolean onFlushDirty(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] currentState, java.lang.Object[] previousState, java.lang.String[] propertyNames, Type[] types)
Interceptor
onFlushDirty
in interface Interceptor
entity
- The entity instance detected as being dirty and being flushedid
- The identifier of the entitycurrentState
- The entity's current statepreviousState
- The entity's previous (load time) state.propertyNames
- The names of the entity propertiestypes
- The types of the entity propertiestrue
if the user modified the currentState in any way.public boolean onLoad(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, Type[] types)
Interceptor
onLoad
in interface Interceptor
entity
- The entity instance being loadedid
- The identifier value being loadedstate
- The entity state (which will be pushed into the entity instance)propertyNames
- The names of the entity properties, corresponding to the state.types
- The types of the entity properties, corresponding to the state.true
if the user modified the state in any way.public boolean onSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, Type[] types)
Interceptor
onSave
in interface Interceptor
entity
- The entity instance whose state is being insertedid
- The identifier of the entitystate
- The state of the entity which will be insertedpropertyNames
- The names of the entity properties.types
- The types of the entity propertiespublic void postFlush(java.util.Iterator entities)
Interceptor
postFlush
in interface Interceptor
entities
- The entities that were flushed.public void preFlush(java.util.Iterator entities)
Interceptor
preFlush
in interface Interceptor
entities
- The entities to be flushed.public java.lang.Boolean isTransient(java.lang.Object entity)
Interceptor
isTransient
in interface Interceptor
entity
- a transient or detached entitypublic java.lang.Object instantiate(java.lang.String entityName, EntityMode entityMode, java.io.Serializable id)
Interceptor
instantiate
in interface Interceptor
entityName
- the name of the entityentityMode
- The type of entity instance to be returned.id
- the identifier of the new instancepublic int[] findDirty(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] currentState, java.lang.Object[] previousState, java.lang.String[] propertyNames, Type[] types)
Interceptor
findDirty
in interface Interceptor
entity
- The entity for which to find dirty properties.id
- The identifier of the entitycurrentState
- The current entity state as taken from the entity instancepreviousState
- The state of the entity when it was last synchronized (generally when it was loaded)propertyNames
- The names of the entity properties.types
- The types of the entity propertiesnull
to indicate Hibernate should perform default behaviourpublic java.lang.String getEntityName(java.lang.Object object)
Interceptor
getEntityName
in interface Interceptor
object
- an entity instancepublic java.lang.Object getEntity(java.lang.String entityName, java.io.Serializable id)
Interceptor
getEntity
in interface Interceptor
entityName
- the name of the entityid
- the instance identifierpublic void afterTransactionBegin(Transaction tx)
Interceptor
afterTransactionBegin
in interface Interceptor
tx
- The Hibernate transaction facade objectpublic void afterTransactionCompletion(Transaction tx)
Interceptor
afterTransactionCompletion
in interface Interceptor
tx
- The Hibernate transaction facade objectpublic void beforeTransactionCompletion(Transaction tx)
Interceptor
beforeTransactionCompletion
in interface Interceptor
tx
- The Hibernate transaction facade objectpublic java.lang.String onPrepareStatement(java.lang.String sql)
Interceptor
onPrepareStatement
in interface Interceptor
sql
- sql to be preparedpublic void onCollectionRemove(java.lang.Object collection, java.io.Serializable key) throws CallbackException
Interceptor
onCollectionRemove
in interface Interceptor
collection
- The collection instance.key
- The collection key value.CallbackException
- Thrown if the interceptor encounters any problems handling the callback.public void onCollectionRecreate(java.lang.Object collection, java.io.Serializable key) throws CallbackException
Interceptor
onCollectionRecreate
in interface Interceptor
collection
- The collection instance.key
- The collection key value.CallbackException
- Thrown if the interceptor encounters any problems handling the callback.public void onCollectionUpdate(java.lang.Object collection, java.io.Serializable key) throws CallbackException
Interceptor
onCollectionUpdate
in interface Interceptor
collection
- The collection instance.key
- The collection key value.CallbackException
- Thrown if the interceptor encounters any problems handling the callback.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.