Top Description Inners Fields Constructors Methods
org.hibernate.cache.internal

public Class CollectionCacheInvalidator

extends Object
implements Integrator, PostInsertEventListener, PostDeleteEventListener, PostUpdateEventListener
Class Inheritance
All Implemented Interfaces
org.hibernate.event.spi.PostUpdateEventListener, org.hibernate.event.spi.PostActionEventListener, org.hibernate.event.spi.PostDeleteEventListener, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.integrator.spi.Integrator
Imports
java.util.Set, org.hibernate.HibernateException, org.hibernate.action.internal.CollectionAction, org.hibernate.action.spi.AfterTransactionCompletionProcess, org.hibernate.boot.Metadata, org.hibernate.boot.spi.SessionFactoryOptions, org.hibernate.cache.spi.access.CollectionDataAccess, .SoftLock, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.spi.SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.event.service.spi.EventListenerRegistry, org.hibernate.event.spi.EventSource, .EventType, .PostDeleteEvent, .PostDeleteEventListener, .PostInsertEvent, .PostInsertEventListener, .PostUpdateEvent, .PostUpdateEventListener, org.hibernate.integrator.spi.Integrator, org.hibernate.metamodel.spi.MappingMetamodelImplementor, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, org.hibernate.service.spi.SessionFactoryServiceRegistry, org.hibernate.tuple.entity.EntityMetamodel, org.jboss.logging.Logger

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.
Author
Andreas Berger

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger
public static boolean
PROPAGATE_EXCEPTION

Exposed for use in testing

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
disintegrate(SessionFactoryImplementor
The session factory being closed.
sessionFactory
,
SessionFactoryServiceRegistry
That session factory's service registry
serviceRegistry
)

Implements org.hibernate.integrator.spi.Integrator.disintegrate.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Tongue-in-cheek name for a shutdown callback.
private void
evict(Object id, CollectionPersister collectionPersister, EventSource session)

private void
evictCache(Object entity, EntityPersister persister, EventSource session, Object[] oldState)

private Object
public void
integrate(Metadata
The "compiled" representation of the mapping information
metadata
,
SessionFactoryImplementor
The session factory being created
sessionFactory
,
SessionFactoryServiceRegistry
The session factory's service registry
serviceRegistry
)

Overrides default org.hibernate.integrator.spi.Integrator.integrate.

Deprecated as a consequence of Metadata and SessionFactoryImplementor being deprecated.
Perform integration.
private void
integrate(SessionFactoryServiceRegistry serviceRegistry, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public void
public void
public void
public boolean
requiresPostCommitHandling(EntityPersister
The persister for the entity in question.
persister
)

Implements org.hibernate.event.spi.PostActionEventListener.requiresPostCommitHandling.

Does this listener require that after transaction hooks be registered?
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG
PROPAGATE_EXCEPTIONback to summary
public static boolean PROPAGATE_EXCEPTION

Exposed for use in testing

Constructor Detail

CollectionCacheInvalidatorback to summary
public CollectionCacheInvalidator()

Method Detail

disintegrateback to summary
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)

Implements org.hibernate.integrator.spi.Integrator.disintegrate.

Doc from org.hibernate.integrator.spi.Integrator.disintegrate.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Tongue-in-cheek name for a shutdown callback.

Parameters
sessionFactory:SessionFactoryImplementor

The session factory being closed.

serviceRegistry:SessionFactoryServiceRegistry

That session factory's service registry

Annotations
@Override
evictback to summary
private void evict(Object id, CollectionPersister collectionPersister, EventSource session)
evictCacheback to summary
private void evictCache(Object entity, EntityPersister persister, EventSource session, Object[] oldState)
getIdentifierback to summary
private Object getIdentifier(EventSource session, Object obj)
integrateback to summary
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)

Overrides default org.hibernate.integrator.spi.Integrator.integrate.

Doc from org.hibernate.integrator.spi.Integrator.integrate.

Deprecated

as a consequence of Metadata and SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Perform integration.

Parameters
metadata:Metadata

The "compiled" representation of the mapping information

sessionFactory:SessionFactoryImplementor

The session factory being created

serviceRegistry:SessionFactoryServiceRegistry

The session factory's service registry

Annotations
@Override
integrateback to summary
private void integrate(SessionFactoryServiceRegistry serviceRegistry, SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

onPostDeleteback to summary
public void onPostDelete(PostDeleteEvent event)

Implements org.hibernate.event.spi.PostDeleteEventListener.onPostDelete.

Annotations
@Override
onPostInsertback to summary
public void onPostInsert(PostInsertEvent event)

Implements org.hibernate.event.spi.PostInsertEventListener.onPostInsert.

Annotations
@Override
onPostUpdateback to summary
public void onPostUpdate(PostUpdateEvent event)

Implements org.hibernate.event.spi.PostUpdateEventListener.onPostUpdate.

Annotations
@Override
requiresPostCommitHandlingback to summary
public boolean requiresPostCommitHandling(EntityPersister persister)

Implements org.hibernate.event.spi.PostActionEventListener.requiresPostCommitHandling.

Doc from org.hibernate.event.spi.PostActionEventListener.requiresPostCommitHandling.

Does this listener require that after transaction hooks be registered?

Parameters
persister:EntityPersister

The persister for the entity in question.

Returns:boolean

true if after transaction callbacks should be added.

Annotations
@Override
org.hibernate.cache.internal back to summary

private final Class CollectionCacheInvalidator.CollectionEvictCacheAction

extends CollectionAction
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
execute()

Implements org.hibernate.action.spi.Executable.execute.

Execute this action.
Inherited from org.hibernate.action.internal.CollectionAction:
afterDeserializebeforeExecutionscompareToeventSourceevictgetAfterTransactionCompletionProcessgetBeforeTransactionCompletionProcessgetCollectiongetFastSessionServicesgetKeygetPersistergetPrimarySortClassifiergetPropertySpacesgetSecondarySortIndexgetSessiontoString

Constructor Detail

CollectionEvictCacheActionback to summary
pack-priv CollectionEvictCacheAction(CollectionPersister persister, PersistentCollection<?> collection, Object key, EventSource session)

Method Detail

executeback to summary
public void execute() throws HibernateException

Implements org.hibernate.action.spi.Executable.execute.

Doc from org.hibernate.action.spi.Executable.execute.

Execute this action.

Annotations
@Override
Exceptions
HibernateException:
Indicates a problem during execution.