mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 12:14:47 +00:00
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 @@ default void integrate(
|
||||
* @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 void onPostUpdate(PostUpdateEvent event) {
|
||||
isPostUpdateCalled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresPostCommitHandling(EntityPersister persister) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isPostUpdateCalled() {
|
||||
return isPostUpdateCalled;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user