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, java.io.Serializable, org.hibernate.event.spi.PostDeleteEventListener, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.integrator.spi.Integrator
Imports
java.io.Serializable, 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.MetamodelImplementor, 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, org.hibernate.cfg.AvailableSettings#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(Serializable id, CollectionPersister collectionPersister, EventSource session)

Deprecated as a consequence of EventSource being deprecated.
private void
evictCache(Object entity, EntityPersister persister, EventSource session, Object[] oldState)

Deprecated as a consequence of EventSource being deprecated.
private Serializable
getIdentifier(EventSource session, Object obj)

Deprecated as a consequence of EventSource being deprecated.
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
)

Implements org.hibernate.integrator.spi.Integrator.integrate.

Deprecated as a consequence of 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
requiresPostCommitHanding(EntityPersister
The persister for the entity in question.
persister
)

Implements org.hibernate.event.spi.PostActionEventListener.requiresPostCommitHanding.

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(Serializable id, CollectionPersister collectionPersister, EventSource session)

Deprecated

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

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

Deprecated

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

getIdentifierback to summary
private Serializable getIdentifier(EventSource session, Object obj)

Deprecated

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

integrateback to summary
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)

Implements org.hibernate.integrator.spi.Integrator.integrate.

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

Deprecated

as a consequence of 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
requiresPostCommitHandingback to summary
public boolean requiresPostCommitHanding(EntityPersister persister)

Implements org.hibernate.event.spi.PostActionEventListener.requiresPostCommitHanding.

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

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
protected

Method Summary

Modifier and TypeMethod and Description
public void
execute()

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

Execute this action.
public AfterTransactionCompletionProcess
Inherited from org.hibernate.action.internal.CollectionAction:
afterDeserializebeforeExecutionscompareToeventSourceevictgetAfterTransactionCompletionProcessgetBeforeTransactionCompletionProcessgetCollectiongetFastSessionServicesgetKeygetPersistergetPropertySpacesgetSessionlistenerGrouptoString

Constructor Detail

CollectionEvictCacheActionback to summary
protected CollectionEvictCacheAction(CollectionPersister persister, PersistentCollection collection, Serializable key, SharedSessionContractImplementor 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.
lockCacheback to summary
public AfterTransactionCompletionProcess lockCache()