public class CollectionCacheInvalidator extends Object implements Integrator, PostInsertEventListener, PostDeleteEventListener, PostUpdateEventListener
AvailableSettings.AUTO_EVICT_COLLECTION_CACHE
must be
enabled. For performance reasons, it's disabled by default.Modifier and Type | Field and Description |
---|---|
static boolean |
PROPAGATE_EXCEPTION
Exposed for use in testing
|
Constructor and Description |
---|
CollectionCacheInvalidator() |
Modifier and Type | Method and Description |
---|---|
void |
disintegrate(SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry)
Tongue-in-cheek name for a shutdown callback.
|
void |
integrate(Metadata metadata,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry)
Perform integration.
|
void |
onPostDelete(PostDeleteEvent event) |
void |
onPostInsert(PostInsertEvent event) |
void |
onPostUpdate(PostUpdateEvent event) |
boolean |
requiresPostCommitHanding(EntityPersister persister)
Does this listener require that after transaction hooks be registered?
|
default boolean |
requiresPostCommitHandling(EntityPersister persister)
Does this listener require that after transaction hooks be registered?
|
public static boolean PROPAGATE_EXCEPTION
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Integrator
integrate
in interface Integrator
metadata
- The "compiled" representation of the mapping informationsessionFactory
- The session factory being createdserviceRegistry
- The session factory's service registrypublic void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Integrator
disintegrate
in interface Integrator
sessionFactory
- The session factory being closed.serviceRegistry
- That session factory's service registrypublic void onPostInsert(PostInsertEvent event)
onPostInsert
in interface PostInsertEventListener
public boolean requiresPostCommitHanding(EntityPersister persister)
persister
- The persister for the entity in question.true
if after transaction callbacks should be added.public void onPostDelete(PostDeleteEvent event)
onPostDelete
in interface PostDeleteEventListener
public void onPostUpdate(PostUpdateEvent event)
onPostUpdate
in interface PostUpdateEventListener
public boolean requiresPostCommitHandling(EntityPersister persister)
persister
- The persister for the entity in question.true
if after transaction callbacks should be added.Copyright © 2019 JBoss by Red Hat. All rights reserved.