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? Typically this is
true
for post-insert event listeners, but may not be, for example, in JPA cases where there are no callbacks defined
for the particular entity. |
public static boolean PROPAGATE_EXCEPTION
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Integratorintegrate in interface Integratormetadata - The "compiled" representation of the mapping informationsessionFactory - The session factory being createdserviceRegistry - The session factory's service registrypublic void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Integratordisintegrate in interface IntegratorsessionFactory - The session factory being closed.serviceRegistry - That session factory's service registrypublic void onPostInsert(PostInsertEvent event)
onPostInsert in interface PostInsertEventListenerpublic boolean requiresPostCommitHanding(EntityPersister persister)
PostInsertEventListenertrue
for post-insert event listeners, but may not be, for example, in JPA cases where there are no callbacks defined
for the particular entity.requiresPostCommitHanding in interface PostDeleteEventListenerrequiresPostCommitHanding in interface PostInsertEventListenerrequiresPostCommitHanding in interface PostUpdateEventListenerpersister - The persister for the entity in question.true if after transaction callbacks should be added.public void onPostDelete(PostDeleteEvent event)
onPostDelete in interface PostDeleteEventListenerpublic void onPostUpdate(PostUpdateEvent event)
onPostUpdate in interface PostUpdateEventListenerCopyright © 2017 JBoss by Red Hat. All rights reserved.