Skip to content

Commit 30f2a20

Browse files
committed
HHH-18458 - Remove deprecated org.hibernate.EmptyInterceptor
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 01b3a22 commit 30f2a20

File tree

11 files changed

+9
-42
lines changed

11 files changed

+9
-42
lines changed

documentation/src/main/asciidoc/userguide/chapters/events/Events.adoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ include::{example-dir-event}/InterceptorTest.java[tags=events-interceptors-examp
2626
----
2727
====
2828

29-
[NOTE]
30-
====
31-
You can either implement `Interceptor` directly or extend the `org.hibernate.EmptyInterceptor` base class.
32-
====
33-
3429
An Interceptor can be either `Session`-scoped or `SessionFactory`-scoped.
3530

3631
A Session-scoped interceptor is specified when a session is opened.

hibernate-core/src/main/java/org/hibernate/EmptyInterceptor.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

hibernate-core/src/main/java/org/hibernate/internal/EmptyInterceptor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
/**
1515
* An interceptor that does nothing.
1616
* This is an internal class and should not be used as a base to implement a custom Interceptor;
17-
* it is similar to the public, deprecated {@link org.hibernate.EmptyInterceptor} but overrides
18-
* the default methods for sake of efficiency: this wasn't possible on the original deprecated
19-
* copy as that wouldn't have been backwards compatible. For this reason this copy is internal.
17+
* it overrides the default methods for sake of efficiency.
2018
*
2119
* Implementors of Interceptor don't need a base class anymore since we now have default
2220
* implementations of the contract defined in the interface.

hibernate-core/src/test/java/org/hibernate/orm/test/interceptor/CollectionInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public boolean onFlushDirty(Object entity, Object id, Object[] currentState, Obj
1818
return false;
1919
}
2020

21-
public boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) {
21+
public boolean onPersist(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) {
2222
( (User) entity ).getActions().add("created");
2323
return false;
2424
}

hibernate-core/src/test/java/org/hibernate/orm/test/interceptor/InterceptorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public void testComponentInterceptor() {
180180
Session s = openSession(
181181
new Interceptor() {
182182
@Override
183-
public boolean onSave(
183+
public boolean onPersist(
184184
Object entity,
185185
Object id,
186186
Object[] state,

hibernate-core/src/test/java/org/hibernate/orm/test/interceptor/PropertyInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public boolean onFlushDirty(Object entity, Object id, Object[] currentState, Obj
2222
}
2323

2424
@Override
25-
public boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) {
25+
public boolean onPersist(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) {
2626
state[2] = Calendar.getInstance();
2727
return true;
2828
}

hibernate-core/src/test/java/org/hibernate/orm/test/interceptor/StatefulInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class StatefulInterceptor implements Interceptor {
2323
private List list = new ArrayList();
2424

2525
@Override
26-
public boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) {
26+
public boolean onPersist(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types) {
2727
if ( !(entity instanceof Log) ) {
2828
list.add( new Log( "insert", (String) id, entity.getClass().getName() ) );
2929
}

hibernate-core/src/test/java/org/hibernate/orm/test/interfaceproxy/DocumentInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public boolean onFlushDirty(
3535
}
3636
}
3737

38-
public boolean onSave(
38+
public boolean onPersist(
3939
Object entity,
4040
Object id,
4141
Object[] state,

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/ejb3configuration/ExceptionInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public boolean onLoad(Object entity, Object id, Object[] state, String[] propert
3434
}
3535

3636
@Override
37-
public boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
37+
public boolean onPersist(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
3838
throws CallbackException {
3939
if (allowSave) return false;
4040
throw new IllegalStateException( EXCEPTION_MESSAGE );

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/ejb3configuration/LocalExceptionInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class LocalExceptionInterceptor extends ExceptionInterceptor {
2020
public static final String LOCAL_EXCEPTION_MESSAGE = "Session-scoped interceptor enabled";
2121

2222
@Override
23-
public boolean onSave(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
23+
public boolean onPersist(Object entity, Object id, Object[] state, String[] propertyNames, Type[] types)
2424
throws CallbackException {
2525
if (allowSave) return false;
2626
throw new IllegalStateException( LOCAL_EXCEPTION_MESSAGE );

0 commit comments

Comments
 (0)