Package org.hibernate.cache.internal
Class CollectionCacheInvalidator
- java.lang.Object
-
- org.hibernate.cache.internal.CollectionCacheInvalidator
-
- All Implemented Interfaces:
PostDeleteEventListener
,PostInsertEventListener
,PostUpdateEventListener
,Integrator
public class CollectionCacheInvalidator extends Object implements Integrator, PostInsertEventListener, PostDeleteEventListener, PostUpdateEventListener
Allows the collection cache to be automatically evicted if an element is inserted/removed/updated *without* properly managing both sides of the association (ie, the ManyToOne collection is changed w/o properly managing the OneToMany). For this functionality to be used, "hibernate.cache.auto_evict_collection_cache" must be enabled. For performance reasons, it's disabled by default.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
PROPAGATE_EXCEPTION
Exposed for use in testing
-
Constructor Summary
Constructors Constructor Description CollectionCacheInvalidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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
requiresPostCommitHandling(EntityPersister persister)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.integrator.spi.Integrator
integrate
-
-
-
-
Method Detail
-
integrate
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Description copied from interface:Integrator
Perform integration.- Specified by:
integrate
in interfaceIntegrator
- Parameters:
metadata
- The "compiled" representation of the mapping informationsessionFactory
- The session factory being createdserviceRegistry
- The session factory's service registry
-
disintegrate
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
Description copied from interface:Integrator
Tongue-in-cheek name for a shutdown callback.- Specified by:
disintegrate
in interfaceIntegrator
- Parameters:
sessionFactory
- The session factory being closed.serviceRegistry
- That session factory's service registry
-
onPostInsert
public void onPostInsert(PostInsertEvent event)
- Specified by:
onPostInsert
in interfacePostInsertEventListener
-
requiresPostCommitHandling
public boolean requiresPostCommitHandling(EntityPersister persister)
-
onPostDelete
public void onPostDelete(PostDeleteEvent event)
- Specified by:
onPostDelete
in interfacePostDeleteEventListener
-
onPostUpdate
public void onPostUpdate(PostUpdateEvent event)
- Specified by:
onPostUpdate
in interfacePostUpdateEventListener
-
-