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.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(Configuration configuration,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry)
Perform integration.
|
void |
integrate(MetadataImplementor 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 void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Integrator
integrate
in interface Integrator
configuration
- The configuration used to create the session factorysessionFactory
- The session factory being createdserviceRegistry
- The session factory's service registrypublic void integrate(MetadataImplementor metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Integrator
integrate
in interface Integrator
metadata
- The metadata used to create the session factorysessionFactory
- 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)
PostInsertEventListener
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.requiresPostCommitHanding
in interface PostDeleteEventListener
requiresPostCommitHanding
in interface PostInsertEventListener
requiresPostCommitHanding
in interface PostUpdateEventListener
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
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.