mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 16:44:57 +00:00
HHH-18452 Remove deprecated org.hibernate.Interceptor methods
This commit is contained in:
parent
e3fd3fad17
commit
37644a42a8
@ -6,7 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.hibernate;
|
package org.hibernate;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.hibernate.metamodel.RepresentationMode;
|
import org.hibernate.metamodel.RepresentationMode;
|
||||||
@ -77,34 +76,6 @@ public interface Interceptor {
|
|||||||
*/
|
*/
|
||||||
default boolean onLoad(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
default boolean onLoad(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
||||||
throws CallbackException {
|
throws CallbackException {
|
||||||
if (id==null || id instanceof Serializable) {
|
|
||||||
return onLoad(entity, (Serializable) id, state, propertyNames, types);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called just before an object is initialized. The interceptor may change the {@code state}, which will
|
|
||||||
* be propagated to the persistent object. Note that when this method is called, {@code entity} will be
|
|
||||||
* an empty uninitialized instance of the class.
|
|
||||||
*
|
|
||||||
* @apiNote The indexes across the {@code state}, {@code propertyNames}, and {@code types} arrays match.
|
|
||||||
*
|
|
||||||
* @param entity The entity instance being loaded
|
|
||||||
* @param id The identifier value being loaded
|
|
||||||
* @param state The entity state (which will be pushed into the entity instance)
|
|
||||||
* @param propertyNames The names of the entity properties, corresponding to the {@code state}.
|
|
||||||
* @param types The types of the entity properties, corresponding to the {@code state}.
|
|
||||||
*
|
|
||||||
* @return {@code true} if the user modified the {@code state} in any way.
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onLoad(Object, Object, Object[], String[], Type[])}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
|
|
||||||
throws CallbackException {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,67 +153,6 @@ default boolean onFlushDirty(
|
|||||||
Object[] previousState,
|
Object[] previousState,
|
||||||
String[] propertyNames,
|
String[] propertyNames,
|
||||||
Type[] types) throws CallbackException {
|
Type[] types) throws CallbackException {
|
||||||
if (id==null || id instanceof Serializable) {
|
|
||||||
return onFlushDirty(entity, (Serializable) id, currentState, previousState, propertyNames, types);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected
|
|
||||||
* {@code 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 {@code currentState} will be propagated to the object, but not necessarily (immediately) to
|
|
||||||
* the database. It is strongly recommended that the interceptor <b>not</b> modify the {@code previousState}.
|
|
||||||
*
|
|
||||||
* @apiNote The indexes across the {@code currentState}, {@code previousState}, {@code propertyNames}, and
|
|
||||||
* {@code types} arrays match.
|
|
||||||
*
|
|
||||||
* @param entity The entity instance detected as being dirty and being flushed
|
|
||||||
* @param id The identifier of the entity
|
|
||||||
* @param currentState The entity's current state
|
|
||||||
* @param previousState The entity's previous (load time) state.
|
|
||||||
* @param propertyNames The names of the entity properties
|
|
||||||
* @param types The types of the entity properties
|
|
||||||
*
|
|
||||||
* @return {@code true} if the user modified the {@code currentState} in any way.
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onFlushDirty(Object, Object, Object[], Object[], String[], Type[])}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default boolean onFlushDirty(
|
|
||||||
Object entity,
|
|
||||||
Serializable id,
|
|
||||||
Object[] currentState,
|
|
||||||
Object[] previousState,
|
|
||||||
String[] propertyNames,
|
|
||||||
Type[] types) throws CallbackException {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called before an object is made persistent by a stateful session.
|
|
||||||
* <p>
|
|
||||||
* The interceptor may modify the {@code state}, which will be used for
|
|
||||||
* the SQL {@code INSERT} and propagated to the persistent object.
|
|
||||||
*
|
|
||||||
* @param entity The entity instance whose state is being inserted
|
|
||||||
* @param id The identifier of the entity
|
|
||||||
* @param state The state of the entity which will be inserted
|
|
||||||
* @param propertyNames The names of the entity properties.
|
|
||||||
* @param types The types of the entity properties
|
|
||||||
*
|
|
||||||
* @return {@code true} if the user modified the {@code state} in any way.
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onSave(Object, Object, Object[], String[], Type[])}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
|
|
||||||
throws CallbackException {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,31 +180,9 @@ default boolean onSave(Object entity, Serializable id, Object[] state, String[]
|
|||||||
@Deprecated(since = "6.6")
|
@Deprecated(since = "6.6")
|
||||||
default boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
default boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
||||||
throws CallbackException {
|
throws CallbackException {
|
||||||
if (id==null || id instanceof Serializable) {
|
|
||||||
return onSave(entity, (Serializable) id, state, propertyNames, types);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called before an object is removed by a stateful session.
|
|
||||||
* <p>
|
|
||||||
* It is not recommended that the interceptor modify the {@code state}.
|
|
||||||
*
|
|
||||||
* @param entity The entity instance being deleted
|
|
||||||
* @param id The identifier of the entity
|
|
||||||
* @param state The state of the entity
|
|
||||||
* @param propertyNames The names of the entity properties.
|
|
||||||
* @param types The types of the entity properties
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onDelete(Object, Object, Object[], String[], Type[])}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
|
|
||||||
throws CallbackException {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called before an object is removed by a stateful session.
|
* Called before an object is removed by a stateful session.
|
||||||
* <p>
|
* <p>
|
||||||
@ -315,23 +203,7 @@ default void onDelete(Object entity, Serializable id, Object[] state, String[] p
|
|||||||
@Deprecated(since = "6.6")
|
@Deprecated(since = "6.6")
|
||||||
default void onDelete(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
default void onDelete(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
||||||
throws CallbackException {
|
throws CallbackException {
|
||||||
if (id==null || id instanceof Serializable) {
|
|
||||||
onDelete(entity, (Serializable) id, state, propertyNames, types);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called before a collection is (re)created.
|
|
||||||
*
|
|
||||||
* @param collection The collection instance.
|
|
||||||
* @param key The collection key value.
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onCollectionRecreate(Object, Object)}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called before a collection is (re)created.
|
* Called before a collection is (re)created.
|
||||||
@ -342,23 +214,7 @@ default void onCollectionRecreate(Object collection, Serializable key) throws Ca
|
|||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
||||||
*/
|
*/
|
||||||
default void onCollectionRecreate(Object collection, Object key) throws CallbackException {
|
default void onCollectionRecreate(Object collection, Object key) throws CallbackException {
|
||||||
if (key instanceof Serializable) {
|
|
||||||
onCollectionRecreate(collection, (Serializable) key);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called before a collection is deleted.
|
|
||||||
*
|
|
||||||
* @param collection The collection instance.
|
|
||||||
* @param key The collection key value.
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onCollectionRemove(Object, Object)}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default void onCollectionRemove(Object collection, Serializable key) throws CallbackException {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called before a collection is deleted.
|
* Called before a collection is deleted.
|
||||||
@ -369,23 +225,7 @@ default void onCollectionRemove(Object collection, Serializable key) throws Call
|
|||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
||||||
*/
|
*/
|
||||||
default void onCollectionRemove(Object collection, Object key) throws CallbackException {
|
default void onCollectionRemove(Object collection, Object key) throws CallbackException {
|
||||||
if (key instanceof Serializable) {
|
|
||||||
onCollectionRemove(collection, (Serializable) key);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called before a collection is updated.
|
|
||||||
*
|
|
||||||
* @param collection The collection instance.
|
|
||||||
* @param key The collection key value.
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #onCollectionUpdate(Object, Object)}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called before a collection is updated.
|
* Called before a collection is updated.
|
||||||
@ -396,9 +236,6 @@ default void onCollectionUpdate(Object collection, Serializable key) throws Call
|
|||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
||||||
*/
|
*/
|
||||||
default void onCollectionUpdate(Object collection, Object key) throws CallbackException {
|
default void onCollectionUpdate(Object collection, Object key) throws CallbackException {
|
||||||
if (key instanceof Serializable) {
|
|
||||||
onCollectionUpdate(collection, (Serializable) key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Called before a flush.
|
* Called before a flush.
|
||||||
@ -436,38 +273,6 @@ default Boolean isTransient(Object entity) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called from {@code flush()}. The return value determines whether the entity is updated
|
|
||||||
* <ul>
|
|
||||||
* <li>an array of property indices - the entity is dirty
|
|
||||||
* <li>an empty array - the entity is not dirty
|
|
||||||
* <li>{@code null} - use Hibernate's default dirty-checking algorithm
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* @param entity The entity for which to find dirty properties.
|
|
||||||
* @param id The identifier of the entity
|
|
||||||
* @param currentState The current entity state as taken from the entity instance
|
|
||||||
* @param previousState The state of the entity when it was last synchronized (generally when it was loaded)
|
|
||||||
* @param propertyNames The names of the entity properties.
|
|
||||||
* @param types The types of the entity properties
|
|
||||||
*
|
|
||||||
* @return array of dirty property indices or {@code null} to indicate Hibernate should perform default behaviour
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #findDirty(Object, Object, Object[], Object[], String[], Type[])}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default int[] findDirty(
|
|
||||||
Object entity,
|
|
||||||
Serializable id,
|
|
||||||
Object[] currentState,
|
|
||||||
Object[] previousState,
|
|
||||||
String[] propertyNames,
|
|
||||||
Type[] types) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from {@code flush()}. The return value determines whether the entity is updated
|
* Called from {@code flush()}. The return value determines whether the entity is updated
|
||||||
* <ul>
|
* <ul>
|
||||||
@ -494,9 +299,6 @@ default int[] findDirty(
|
|||||||
Object[] previousState,
|
Object[] previousState,
|
||||||
String[] propertyNames,
|
String[] propertyNames,
|
||||||
Type[] types) {
|
Type[] types) {
|
||||||
if (id==null || id instanceof Serializable) {
|
|
||||||
return findDirty(entity, (Serializable) id, currentState, previousState, propertyNames, types);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,23 +341,6 @@ default String getEntityName(Object object) throws CallbackException {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a fully loaded entity instance that is cached externally.
|
|
||||||
*
|
|
||||||
* @param entityName the name of the entity
|
|
||||||
* @param id the instance identifier
|
|
||||||
*
|
|
||||||
* @return a fully initialized entity
|
|
||||||
*
|
|
||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
|
||||||
*
|
|
||||||
* @deprecated use {@link #getEntity(String, Object)}
|
|
||||||
*/
|
|
||||||
@Deprecated(since = "6.0")
|
|
||||||
default Object getEntity(String entityName, Serializable id) throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a fully loaded entity instance that is cached externally.
|
* Get a fully loaded entity instance that is cached externally.
|
||||||
*
|
*
|
||||||
@ -567,9 +352,6 @@ default Object getEntity(String entityName, Serializable id) throws CallbackExce
|
|||||||
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
* @throws CallbackException Thrown if the interceptor encounters any problems handling the callback.
|
||||||
*/
|
*/
|
||||||
default Object getEntity(String entityName, Object id) throws CallbackException {
|
default Object getEntity(String entityName, Object id) throws CallbackException {
|
||||||
if (id==null || id instanceof Serializable) {
|
|
||||||
return getEntity(entityName, (Serializable) id);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||||
@ -296,7 +296,7 @@ public String toString() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class TransactionInterceptor extends EmptyInterceptor {
|
private final class TransactionInterceptor implements Interceptor {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTransactionCompletion(Transaction tx) {
|
public void beforeTransactionCompletion(Transaction tx) {
|
||||||
if ( interceptTransaction.get() ) {
|
if ( interceptTransaction.get() ) {
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.hibernate.orm.test.dirtiness;
|
package org.hibernate.orm.test.dirtiness;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import org.hibernate.CustomEntityDirtinessStrategy;
|
import org.hibernate.CustomEntityDirtinessStrategy;
|
||||||
import org.hibernate.Interceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
@ -203,7 +201,7 @@ public static class OnFlushDirtyInterceptor implements Interceptor {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onFlushDirty(
|
public boolean onFlushDirty(
|
||||||
Object entity,
|
Object entity,
|
||||||
Serializable id,
|
Object id,
|
||||||
Object[] currentState,
|
Object[] currentState,
|
||||||
Object[] previousState,
|
Object[] previousState,
|
||||||
String[] propertyNames,
|
String[] propertyNames,
|
||||||
|
@ -7,14 +7,13 @@
|
|||||||
|
|
||||||
//$Id: CollectionInterceptor.java 7700 2005-07-30 05:02:47Z oneovthafew $
|
//$Id: CollectionInterceptor.java 7700 2005-07-30 05:02:47Z oneovthafew $
|
||||||
package org.hibernate.orm.test.interceptor;
|
package org.hibernate.orm.test.interceptor;
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
public class CollectionInterceptor extends EmptyInterceptor {
|
public class CollectionInterceptor implements Interceptor {
|
||||||
|
|
||||||
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
|
public boolean onFlushDirty(Object entity, Object id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
|
||||||
( (User) entity ).getActions().add("updated");
|
( (User) entity ).getActions().add("updated");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
package org.hibernate.orm.test.interceptor;
|
package org.hibernate.orm.test.interceptor;
|
||||||
|
|
||||||
import org.hibernate.CallbackException;
|
import org.hibernate.CallbackException;
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.metamodel.RepresentationMode;
|
import org.hibernate.metamodel.RepresentationMode;
|
||||||
|
|
||||||
public class InstantiateInterceptor extends EmptyInterceptor {
|
public class InstantiateInterceptor implements Interceptor {
|
||||||
private String injectedString;
|
private String injectedString;
|
||||||
|
|
||||||
public InstantiateInterceptor(String injectedString) {
|
public InstantiateInterceptor(String injectedString) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
import org.hibernate.resource.transaction.spi.TransactionStatus;
|
import org.hibernate.resource.transaction.spi.TransactionStatus;
|
||||||
@ -205,7 +205,7 @@ public void setName(String name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TransactionInterceptor extends EmptyInterceptor {
|
private class TransactionInterceptor implements Interceptor {
|
||||||
private boolean afterTransactionBeginMethodCalled;
|
private boolean afterTransactionBeginMethodCalled;
|
||||||
private Boolean afterTransactionBeginAssertionPassed;
|
private Boolean afterTransactionBeginAssertionPassed;
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
import jakarta.persistence.PersistenceException;
|
import jakarta.persistence.PersistenceException;
|
||||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||||
import jakarta.persistence.criteria.CriteriaQuery;
|
import jakarta.persistence.criteria.CriteriaQuery;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -18,7 +17,6 @@
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.EmptyInterceptor;
|
|
||||||
import org.hibernate.Interceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
@ -108,11 +106,11 @@ public void testPropertyIntercept2() {
|
|||||||
s.close();
|
s.close();
|
||||||
|
|
||||||
s = openSession(
|
s = openSession(
|
||||||
new EmptyInterceptor() {
|
new Interceptor() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onFlushDirty(
|
public boolean onFlushDirty(
|
||||||
Object entity,
|
Object entity,
|
||||||
Serializable id,
|
Object id,
|
||||||
Object[] currentState,
|
Object[] currentState,
|
||||||
Object[] previousState,
|
Object[] previousState,
|
||||||
String[] propertyNames,
|
String[] propertyNames,
|
||||||
@ -180,7 +178,7 @@ public void testComponentInterceptor() {
|
|||||||
final String checkComment = "generated from interceptor";
|
final String checkComment = "generated from interceptor";
|
||||||
|
|
||||||
Session s = openSession(
|
Session s = openSession(
|
||||||
new EmptyInterceptor() {
|
new Interceptor() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onSave(
|
public boolean onSave(
|
||||||
Object entity,
|
Object entity,
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.hibernate.orm.test.interceptor;
|
package org.hibernate.orm.test.interceptor;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
|
||||||
import org.hibernate.Interceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
@ -44,7 +43,7 @@ public void testTransactionEvents() {
|
|||||||
assertTrue("beforeTransactionCompletionCalled not called", interceptor.isBeforeTransactionCompletionCalled());
|
assertTrue("beforeTransactionCompletionCalled not called", interceptor.isBeforeTransactionCompletionCalled());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class LoggingInterceptor extends EmptyInterceptor {
|
private static class LoggingInterceptor implements Interceptor {
|
||||||
private boolean afterTransactionBeginCalled;
|
private boolean afterTransactionBeginCalled;
|
||||||
private boolean afterTransactionCompletionCalled;
|
private boolean afterTransactionCompletionCalled;
|
||||||
private boolean beforeTransactionCompletionCalled;
|
private boolean beforeTransactionCompletionCalled;
|
||||||
|
@ -7,16 +7,16 @@
|
|||||||
|
|
||||||
//$Id: PropertyInterceptor.java 7700 2005-07-30 05:02:47Z oneovthafew $
|
//$Id: PropertyInterceptor.java 7700 2005-07-30 05:02:47Z oneovthafew $
|
||||||
package org.hibernate.orm.test.interceptor;
|
package org.hibernate.orm.test.interceptor;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
public class PropertyInterceptor extends EmptyInterceptor {
|
public class PropertyInterceptor implements Interceptor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
|
public boolean onFlushDirty(Object entity, Object id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
|
||||||
currentState[1] = Calendar.getInstance();
|
currentState[1] = Calendar.getInstance();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,16 @@
|
|||||||
|
|
||||||
//$Id: StatefulInterceptor.java 7701 2005-07-30 05:07:01Z oneovthafew $
|
//$Id: StatefulInterceptor.java 7701 2005-07-30 05:07:01Z oneovthafew $
|
||||||
package org.hibernate.orm.test.interceptor;
|
package org.hibernate.orm.test.interceptor;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
public class StatefulInterceptor extends EmptyInterceptor {
|
public class StatefulInterceptor implements Interceptor {
|
||||||
|
|
||||||
private Session session;
|
private Session session;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ public boolean onSave(Object entity, Object id, Object[] state, String[] propert
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
|
public boolean onFlushDirty(Object entity, Object id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
|
||||||
if ( !(entity instanceof Log) ) {
|
if ( !(entity instanceof Log) ) {
|
||||||
list.add( new Log( "update", (String) id, entity.getClass().getName() ) );
|
list.add( new Log( "update", (String) id, entity.getClass().getName() ) );
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,10 @@
|
|||||||
//$Id: DocumentInterceptor.java 7860 2005-08-11 21:58:23Z oneovthafew $
|
//$Id: DocumentInterceptor.java 7860 2005-08-11 21:58:23Z oneovthafew $
|
||||||
package org.hibernate.orm.test.interfaceproxy;
|
package org.hibernate.orm.test.interfaceproxy;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.hibernate.CallbackException;
|
import org.hibernate.CallbackException;
|
||||||
import org.hibernate.Interceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Transaction;
|
|
||||||
import org.hibernate.metamodel.RepresentationMode;
|
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,14 +19,13 @@
|
|||||||
*/
|
*/
|
||||||
public class DocumentInterceptor implements Interceptor {
|
public class DocumentInterceptor implements Interceptor {
|
||||||
|
|
||||||
public boolean onLoad(Object entity, Serializable id, Object[] state,
|
public boolean onFlushDirty(
|
||||||
String[] propertyNames, Type[] types) throws CallbackException {
|
Object entity,
|
||||||
return false;
|
Object id,
|
||||||
}
|
Object[] currentState,
|
||||||
|
Object[] previousState,
|
||||||
public boolean onFlushDirty(Object entity, Serializable id,
|
String[] propertyNames,
|
||||||
Object[] currentState, Object[] previousState,
|
Type[] types) throws CallbackException {
|
||||||
String[] propertyNames, Type[] types) throws CallbackException {
|
|
||||||
if ( entity instanceof Document ) {
|
if ( entity instanceof Document ) {
|
||||||
currentState[2] = Calendar.getInstance();
|
currentState[2] = Calendar.getInstance();
|
||||||
return true;
|
return true;
|
||||||
@ -40,8 +35,12 @@ public boolean onFlushDirty(Object entity, Serializable id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onSave(Object entity, Object id, Object[] state,
|
public boolean onSave(
|
||||||
String[] propertyNames, Type[] types) throws CallbackException {
|
Object entity,
|
||||||
|
Object id,
|
||||||
|
Object[] state,
|
||||||
|
String[] propertyNames,
|
||||||
|
Type[] types) throws CallbackException {
|
||||||
if ( entity instanceof Document ) {
|
if ( entity instanceof Document ) {
|
||||||
state[3] = state[2] = Calendar.getInstance();
|
state[3] = state[2] = Calendar.getInstance();
|
||||||
return true;
|
return true;
|
||||||
@ -51,48 +50,12 @@ public boolean onSave(Object entity, Object id, Object[] state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDelete(Object entity, Serializable id, Object[] state,
|
public void onDelete(
|
||||||
String[] propertyNames, Type[] types) throws CallbackException {
|
Object entity,
|
||||||
|
Object id,
|
||||||
|
Object[] state,
|
||||||
|
String[] propertyNames,
|
||||||
|
Type[] types) throws CallbackException {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preFlush(Iterator entities) throws CallbackException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void postFlush(Iterator entities) throws CallbackException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isTransient(Object entity) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] findDirty(Object entity, Serializable id,
|
|
||||||
Object[] currentState, Object[] previousState,
|
|
||||||
String[] propertyNames, Type[] types) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object instantiate(String entityName, RepresentationMode entityMode, Object id) throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEntityName(Object object) throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getEntity(String entityName, Serializable id)
|
|
||||||
throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void afterTransactionBegin(Transaction tx) {}
|
|
||||||
public void afterTransactionCompletion(Transaction tx) {}
|
|
||||||
public void beforeTransactionCompletion(Transaction tx) {}
|
|
||||||
|
|
||||||
public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {}
|
|
||||||
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {}
|
|
||||||
public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.hibernate.orm.test.jpa.callbacks;
|
package org.hibernate.orm.test.jpa.callbacks;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -21,7 +19,7 @@
|
|||||||
import jakarta.persistence.PrePersist;
|
import jakarta.persistence.PrePersist;
|
||||||
import jakarta.persistence.PreUpdate;
|
import jakarta.persistence.PreUpdate;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.SessionBuilder;
|
import org.hibernate.SessionBuilder;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
@ -67,14 +65,14 @@ public void testPreUpdateModifications() {
|
|||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class OnFlushDirtyInterceptor extends EmptyInterceptor {
|
public static class OnFlushDirtyInterceptor implements Interceptor {
|
||||||
|
|
||||||
private static OnFlushDirtyInterceptor INSTANCE = new OnFlushDirtyInterceptor();
|
private static OnFlushDirtyInterceptor INSTANCE = new OnFlushDirtyInterceptor();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] findDirty(
|
public int[] findDirty(
|
||||||
Object entity,
|
Object entity,
|
||||||
Serializable id,
|
Object id,
|
||||||
Object[] currentState,
|
Object[] currentState,
|
||||||
Object[] previousState,
|
Object[] previousState,
|
||||||
String[] propertyNames,
|
String[] propertyNames,
|
||||||
|
@ -8,16 +8,14 @@
|
|||||||
//$Id$
|
//$Id$
|
||||||
package org.hibernate.orm.test.jpa.ejb3configuration;
|
package org.hibernate.orm.test.jpa.ejb3configuration;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import org.hibernate.CallbackException;
|
import org.hibernate.CallbackException;
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class ExceptionInterceptor extends EmptyInterceptor {
|
public class ExceptionInterceptor implements Interceptor {
|
||||||
public static final String EXCEPTION_MESSAGE = "Interceptor enabled";
|
public static final String EXCEPTION_MESSAGE = "Interceptor enabled";
|
||||||
protected boolean allowSave = false;
|
protected boolean allowSave = false;
|
||||||
|
|
||||||
@ -30,7 +28,7 @@ public ExceptionInterceptor(boolean allowSave) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
|
public boolean onLoad(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
|
||||||
throws CallbackException {
|
throws CallbackException {
|
||||||
throw new IllegalStateException( EXCEPTION_MESSAGE );
|
throw new IllegalStateException( EXCEPTION_MESSAGE );
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,10 @@
|
|||||||
//$Id: DocumentInterceptor.java 8670 2005-11-25 17:36:29Z epbernard $
|
//$Id: DocumentInterceptor.java 8670 2005-11-25 17:36:29Z epbernard $
|
||||||
package org.hibernate.orm.test.mixed;
|
package org.hibernate.orm.test.mixed;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.hibernate.CallbackException;
|
import org.hibernate.CallbackException;
|
||||||
import org.hibernate.Interceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Transaction;
|
|
||||||
import org.hibernate.metamodel.RepresentationMode;
|
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,19 +19,13 @@
|
|||||||
*/
|
*/
|
||||||
public class DocumentInterceptor implements Interceptor {
|
public class DocumentInterceptor implements Interceptor {
|
||||||
|
|
||||||
|
|
||||||
public boolean onLoad(
|
|
||||||
Object entity, Serializable id, Object[] state,
|
|
||||||
String[] propertyNames, Type[] types
|
|
||||||
) throws CallbackException {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onFlushDirty(
|
public boolean onFlushDirty(
|
||||||
Object entity, Serializable id,
|
Object entity,
|
||||||
Object[] currentState, Object[] previousState,
|
Object id,
|
||||||
String[] propertyNames, Type[] types
|
Object[] currentState,
|
||||||
) throws CallbackException {
|
Object[] previousState,
|
||||||
|
String[] propertyNames,
|
||||||
|
Type[] types) throws CallbackException {
|
||||||
if ( entity instanceof Document ) {
|
if ( entity instanceof Document ) {
|
||||||
currentState[3] = Calendar.getInstance();
|
currentState[3] = Calendar.getInstance();
|
||||||
return true;
|
return true;
|
||||||
@ -46,9 +36,11 @@ public boolean onFlushDirty(
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean onSave(
|
public boolean onSave(
|
||||||
Object entity, Object id, Object[] state,
|
Object entity,
|
||||||
String[] propertyNames, Type[] types
|
Object id,
|
||||||
) throws CallbackException {
|
Object[] state,
|
||||||
|
String[] propertyNames,
|
||||||
|
Type[] types) throws CallbackException {
|
||||||
if ( entity instanceof Document ) {
|
if ( entity instanceof Document ) {
|
||||||
state[4] = state[3] = Calendar.getInstance();
|
state[4] = state[3] = Calendar.getInstance();
|
||||||
return true;
|
return true;
|
||||||
@ -59,60 +51,11 @@ public boolean onSave(
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onDelete(
|
public void onDelete(
|
||||||
Object entity, Serializable id, Object[] state,
|
Object entity,
|
||||||
String[] propertyNames, Type[] types
|
Object id,
|
||||||
) throws CallbackException {
|
Object[] state,
|
||||||
|
String[] propertyNames,
|
||||||
|
Type[] types) throws CallbackException {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preFlush(Iterator entities) throws CallbackException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void postFlush(Iterator entities) throws CallbackException {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isTransient(Object entity) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] findDirty(
|
|
||||||
Object entity, Serializable id,
|
|
||||||
Object[] currentState, Object[] previousState,
|
|
||||||
String[] propertyNames, Type[] types
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object instantiate(String entityName, RepresentationMode entityMode, Object id) throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEntityName(Object object) throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getEntity(String entityName, Serializable id)
|
|
||||||
throws CallbackException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void afterTransactionBegin(Transaction tx) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void afterTransactionCompletion(Transaction tx) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void beforeTransactionCompletion(Transaction tx) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,21 +6,17 @@
|
|||||||
*/
|
*/
|
||||||
package org.hibernate.orm.test.querycache;
|
package org.hibernate.orm.test.querycache;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionBuilder;
|
import org.hibernate.SessionBuilder;
|
||||||
import org.hibernate.Transaction;
|
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
import org.hibernate.query.NativeQuery;
|
import org.hibernate.query.NativeQuery;
|
||||||
import org.hibernate.query.Query;
|
import org.hibernate.query.Query;
|
||||||
@ -724,17 +720,11 @@ protected Item findByDescription(SessionBuilder sessionBuilder, final String des
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DelayLoadOperations extends EmptyInterceptor {
|
public class DelayLoadOperations implements Interceptor {
|
||||||
|
|
||||||
private volatile CountDownLatch blockLatch;
|
private volatile CountDownLatch blockLatch;
|
||||||
private volatile CountDownLatch waitLatch;
|
private volatile CountDownLatch waitLatch;
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
|
|
||||||
onLoad();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLoad(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types){
|
public boolean onLoad(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types){
|
||||||
onLoad();
|
onLoad();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
import jakarta.transaction.Status;
|
import jakarta.transaction.Status;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
@ -307,7 +307,7 @@ public void setName(String name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TransactionInterceptor extends EmptyInterceptor {
|
private class TransactionInterceptor implements Interceptor {
|
||||||
private boolean afterTransactionBeginMethodCalled;
|
private boolean afterTransactionBeginMethodCalled;
|
||||||
private Boolean afterTransactionBeginAssertionPassed;
|
private Boolean afterTransactionBeginAssertionPassed;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.Transaction;
|
import org.hibernate.Transaction;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
@ -17,7 +17,7 @@
|
|||||||
/**
|
/**
|
||||||
* @author Chris Cranford
|
* @author Chris Cranford
|
||||||
*/
|
*/
|
||||||
public class TestInterceptor extends EmptyInterceptor {
|
public class TestInterceptor implements Interceptor {
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger( TestInterceptor.class );
|
private static final Logger LOGGER = Logger.getLogger( TestInterceptor.class );
|
||||||
private static Map<TestInterceptor, Integer> interceptorInvocations = new HashMap<>();
|
private static Map<TestInterceptor, Integer> interceptorInvocations = new HashMap<>();
|
||||||
@ -28,7 +28,6 @@ public TestInterceptor() {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeTransactionCompletion(Transaction tx) {
|
public void beforeTransactionCompletion(Transaction tx) {
|
||||||
super.beforeTransactionCompletion(tx);
|
|
||||||
interceptorInvocations.put( this, interceptorInvocations.get( this ) + 1 );
|
interceptorInvocations.put( this, interceptorInvocations.get( this ) + 1 );
|
||||||
LOGGER.info( "Interceptor beforeTransactionCompletion invoked" );
|
LOGGER.info( "Interceptor beforeTransactionCompletion invoked" );
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,15 @@ XML processing.
|
|||||||
* Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE`
|
* Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE`
|
||||||
* Removed the attribute value from `@DynamicInsert` and `@DynamicUpdate`
|
* Removed the attribute value from `@DynamicInsert` and `@DynamicUpdate`
|
||||||
* Removed `org.hibernate.integrator.spi.Integrator#integrate(Metadata,SessionFactoryImplementor,SessionFactoryServiceRegistry)` in favor of `org.hibernate.integrator.spi.Integrator#integrate(Metadata,BootstrapContext,SessionFactoryImplementor)`
|
* Removed `org.hibernate.integrator.spi.Integrator#integrate(Metadata,SessionFactoryImplementor,SessionFactoryServiceRegistry)` in favor of `org.hibernate.integrator.spi.Integrator#integrate(Metadata,BootstrapContext,SessionFactoryImplementor)`
|
||||||
|
* Removed `org.hibernate.Interceptor#onLoad(Object, Serializable, Object[] , String[] , Type[] )` in favour of `org.hibernate.Interceptor#onLoad(Object, Object, Object[], String[], Type[] )`
|
||||||
|
* Removed `org.hibernate.Interceptor#onFlushDirty(Object, Serializable, Object[] , Object[], String[] , Type[] )` in favour of `org.hibernate.Interceptor#onLoad(Object, Object, Object[], Object[], String[] , Type[] )`
|
||||||
|
* Removed `org.hibernate.Interceptor#onSave(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onSave(Object, Object, Object[], String[], Type[])`
|
||||||
|
* Removed `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])`
|
||||||
|
* Removed `org.hibernate.Interceptor#onCollectionRecreate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRecreate(Object, Object)`
|
||||||
|
* Removed `org.hibernate.Interceptor#onCollectionRemove(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRemove(Object, Object)`
|
||||||
|
* Removed `org.hibernate.Interceptor#onCollectionUpdate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionUpdate(Object, Object)`
|
||||||
|
* Removed `org.hibernate.Interceptor#findDirty(Object, Serializable, Object[], Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#findDirty(Object, Object, Object[], Object[], String[], Type[])`
|
||||||
|
* Removed `org.hibernate.Interceptor#getEntity(String, Serializable)` in favour of `org.hibernate.Interceptor#getEntity(String, Serializable)`
|
||||||
|
|
||||||
[[todo]]
|
[[todo]]
|
||||||
== Todos (dev)
|
== Todos (dev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user