a couple of small optimizations to writing Integrators
default impls for: - Integrator.disintegrate() - PostActionEventListener.requiresPostCommitHandling() Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
20bc303ca6
commit
fd30841c33
|
@ -20,5 +20,7 @@ interface PostActionEventListener {
|
|||
*
|
||||
* @return {@code true} if after transaction callbacks should be added.
|
||||
*/
|
||||
boolean requiresPostCommitHandling(EntityPersister persister);
|
||||
default boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,6 +71,8 @@ public interface Integrator {
|
|||
* @param sessionFactory The session factory being closed.
|
||||
* @param serviceRegistry That session factory's service registry
|
||||
*/
|
||||
void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry);
|
||||
default void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
||||
// do nothing by default
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,11 +53,6 @@ public class LoadEntityWithElementCollectionTest {
|
|||
isPostUpdateCalled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isPostUpdateCalled() {
|
||||
return isPostUpdateCalled;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue