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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintegrate(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) Perform integration.voidonPostDelete(PostDeleteEvent event) voidonPostInsert(PostInsertEvent event) voidonPostUpdate(PostUpdateEvent event) booleanrequiresPostCommitHandling(EntityPersister persister) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.integrator.spi.Integrator
disintegrate
-
Field Details
-
PROPAGATE_EXCEPTION
public static boolean PROPAGATE_EXCEPTIONExposed for use in testing
-
-
Constructor Details
-
CollectionCacheInvalidator
public CollectionCacheInvalidator()
-
-
Method Details
-
integrate
public void integrate(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) Description copied from interface:IntegratorPerform integration.- Specified by:
integratein interfaceIntegrator- Parameters:
metadata- The fully initialized boot-time mapping modelbootstrapContext- The context for bootstrapping of the SessionFactorysessionFactory- The SessionFactory being created
-
onPostInsert
- Specified by:
onPostInsertin interfacePostInsertEventListener
-
requiresPostCommitHandling
-
onPostDelete
- Specified by:
onPostDeletein interfacePostDeleteEventListener
-
onPostUpdate
- Specified by:
onPostUpdatein interfacePostUpdateEventListener
-