|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.EmptyInterceptor
public class EmptyInterceptor
An interceptor that does nothing. May be used as a base class for application-defined custom interceptors.
| Field Summary | |
|---|---|
static Interceptor |
INSTANCE
|
| Constructor Summary | |
|---|---|
protected |
EmptyInterceptor()
|
| Method Summary | |
|---|---|
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(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types)
Called from flush(). |
Object |
getEntity(String entityName,
Serializable id)
Get a fully loaded entity instance that is cached externally |
String |
getEntityName(Object object)
Get the entity name for a persistent or transient instance |
Object |
instantiate(String entityName,
EntityMode entityMode,
Serializable id)
Instantiate the entity class. |
Boolean |
isTransient(Object entity)
Called to distinguish between transient and detached entities. |
void |
onCollectionRecreate(Object collection,
Serializable key)
Called before a collection is (re)created. |
void |
onCollectionRemove(Object collection,
Serializable key)
Called before a collection is deleted. |
void |
onCollectionUpdate(Object collection,
Serializable key)
Called before a collection is updated. |
void |
onDelete(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Called before an object is deleted. |
boolean |
onFlushDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types)
Called when an object is detected to be dirty, during a flush. |
boolean |
onLoad(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Called just before an object is initialized. |
String |
onPrepareStatement(String sql)
Called when sql string is being prepared. |
boolean |
onSave(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Called before an object is saved. |
void |
postFlush(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(Iterator entities)
Called before a flush |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Interceptor INSTANCE
| Constructor Detail |
|---|
protected EmptyInterceptor()
| Method Detail |
|---|
public void onDelete(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Interceptor
onDelete in interface Interceptorentity - 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 properties
public boolean onFlushDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types)
Interceptor
onFlushDirty in interface Interceptorentity - 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 properties
true if the user modified the currentState in any way.
public boolean onLoad(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Interceptor
onLoad in interface Interceptorentity - 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(Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types)
Interceptor
onSave in interface Interceptorentity - 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 properties
public void postFlush(Iterator entities)
Interceptor
postFlush in interface Interceptorentities - The entities that were flushed.public void preFlush(Iterator entities)
Interceptor
preFlush in interface Interceptorentities - The entities to be flushedpublic Boolean isTransient(Object entity)
Interceptor
isTransient in interface Interceptorentity - a transient or detached entity
public Object instantiate(String entityName,
EntityMode entityMode,
Serializable id)
Interceptor
instantiate in interface InterceptorentityName - the name of the entityentityMode - The type of entity instance to be returned.id - the identifier of the new instance
public int[] findDirty(Object entity,
Serializable id,
Object[] currentState,
Object[] previousState,
String[] propertyNames,
Type[] types)
Interceptor
findDirty in interface Interceptorentity - 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 properties
null to indicate Hibernate should perform default behaviourpublic String getEntityName(Object object)
Interceptor
getEntityName in interface Interceptorobject - an entity instance
public Object getEntity(String entityName,
Serializable id)
Interceptor
getEntity in interface InterceptorentityName - the name of the entityid - the instance identifier
public void afterTransactionBegin(Transaction tx)
Interceptor
afterTransactionBegin in interface Interceptortx - The Hibernate transaction facade objectpublic void afterTransactionCompletion(Transaction tx)
Interceptor
afterTransactionCompletion in interface Interceptortx - The Hibernate transaction facade objectpublic void beforeTransactionCompletion(Transaction tx)
Interceptor
beforeTransactionCompletion in interface Interceptortx - The Hibernate transaction facade objectpublic String onPrepareStatement(String sql)
Interceptor
onPrepareStatement in interface Interceptorsql - sql to be prepared
public void onCollectionRemove(Object collection,
Serializable key)
throws CallbackException
Interceptor
onCollectionRemove in interface Interceptorcollection - The collection instance.key - The collection key value.
CallbackException - Thrown if the interceptor encounters any problems handling the callback.
public void onCollectionRecreate(Object collection,
Serializable key)
throws CallbackException
Interceptor
onCollectionRecreate in interface Interceptorcollection - The collection instance.key - The collection key value.
CallbackException - Thrown if the interceptor encounters any problems handling the callback.
public void onCollectionUpdate(Object collection,
Serializable key)
throws CallbackException
Interceptor
onCollectionUpdate in interface Interceptorcollection - The collection instance.key - The collection key value.
CallbackException - Thrown if the interceptor encounters any problems handling the callback.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||