| Modifier and Type | Field and Description |
|---|---|
| public static final Interceptor |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterTransactionBegin(Transaction tx)
Implements org. |
| public void | afterTransactionCompletion(Transaction tx)
Implements org. |
| public void | beforeTransactionCompletion(Transaction tx)
Implements org. |
| public int[] | findDirty(Object
a persistent entity entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types)Implements org. |
| public Object | getEntity(String
the name of the entity entityName, Serializable the instance identifier id)Implements org. |
| public String | getEntityName(Object
an entity instance object)Implements org. |
| public Object | instantiate(String
the name of the entity entityName, EntityMode The type of entity instance to be returned. entityMode, Serializable the identifier of the new instance id)Implements org. |
| public Boolean | isTransient(Object
a transient or detached entity entity)Implements org. |
| public void | onCollectionRecreate(Object collection, Serializable key)
Implements org. |
| public void | onCollectionRemove(Object collection, Serializable key)
Implements org. |
| public void | onCollectionUpdate(Object collection, Serializable key)
Implements org. |
| public void | onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
Implements org. |
| public boolean | onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types)
Implements org. |
| public boolean | onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
Implements org. |
| public String | onPrepareStatement(String
sql to be prepared sql)Implements org. |
| public boolean | onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
Implements org. |
| public void | postFlush(Iterator<E> entities)
Implements org. |
| public void |
| INSTANCE | back to summary |
|---|---|
| public static final Interceptor INSTANCE | |
| EmptyInterceptor | back to summary |
|---|---|
| protected EmptyInterceptor() | |
| afterTransactionBegin | back to summary |
|---|---|
| public void afterTransactionBegin(Transaction tx) Implements org. Doc from org. Called when a Hibernate transaction is begun via the Hibernate Transaction API. Will not be called if transactions are being controlled via some other mechanism (CMT, for example). | |
| afterTransactionCompletion | back to summary |
|---|---|
| public void afterTransactionCompletion(Transaction tx) Implements org. Doc from org. Called after a transaction is committed or rolled back. | |
| beforeTransactionCompletion | back to summary |
|---|---|
| public void beforeTransactionCompletion(Transaction tx) Implements org. Doc from org. Called before a transaction is committed (but not before rollback). | |
| findDirty | back to summary |
|---|---|
| public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) Implements org. Doc from org. Called from flush(). The return value determines whether the entity is updated
| |
| getEntity | back to summary |
|---|---|
| public Object getEntity(String entityName, Serializable id) Implements org. Doc from org. Get a fully loaded entity instance that is cached externally
| |
| getEntityName | back to summary |
|---|---|
| public String getEntityName(Object object) Implements org. Doc from org. Get the entity name for a persistent or transient instance | |
| instantiate | back to summary |
|---|---|
| public Object instantiate(String entityName, EntityMode entityMode, Serializable id) Implements org. Doc from org. Instantiate the entity class. Return null to indicate that Hibernate should use the default constructor of the class. The identifier property of the returned instance should be initialized with the given identifier.
| |
| isTransient | back to summary |
|---|---|
| public Boolean isTransient(Object entity) Implements org. Doc from org. Called to distinguish between transient and detached entities. The return value determines the state of the entity with respect to the current session.
| |
| onCollectionRecreate | back to summary |
|---|---|
| public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException Implements org. Doc from org. Called before a collection is (re)created. | |
| onCollectionRemove | back to summary |
|---|---|
| public void onCollectionRemove(Object collection, Serializable key) throws CallbackException Implements org. Doc from org. Called before a collection is deleted. | |
| onCollectionUpdate | back to summary |
|---|---|
| public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException Implements org. Doc from org. Called before a collection is updated. | |
| onDelete | back to summary |
|---|---|
| public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) Implements org. Doc from org. Called before an object is deleted. It is not recommended that the interceptor modify the state. | |
| onFlushDirty | back to summary |
|---|---|
| public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) Implements org. Doc from org. Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected currentState, which will be propagated to both the database and the persistent object. Note that not all flushes end in actual synchronization with the database, in which case the new currentState will be propagated to the object, but not necessarily (immediately) to the database. It is strongly recommended that the interceptor not modify the previousState.
| |
| onLoad | back to summary |
|---|---|
| public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) Implements org. Doc from org. Called just before an object is initialized. The interceptor may change the state, which will be propagated to the persistent object. Note that when this method is called, entity will be an empty uninitialized instance of the class.
| |
| onPrepareStatement | back to summary |
|---|---|
| public String onPrepareStatement(String sql) Implements org. Doc from org. Called when sql string is being prepared. | |
| onSave | back to summary |
|---|---|
| public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) Implements org. Doc from org. Called before an object is saved. The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object.
| |
| postFlush | back to summary |
|---|---|
| public void postFlush(Iterator<E> entities) Implements org. Doc from org. Called after a flush that actually ends in execution of the SQL statements required to synchronize in-memory state with the database. | |
| preFlush | back to summary |
|---|---|
| public void preFlush(Iterator<E> entities) Implements org. Doc from org. Called before a flush | |