Top Description Methods
org.hibernate.cache.spi.access

public Interface CollectionDataAccess

extends CachedDomainDataAccess
Known Direct Implementers
org.hibernate.cache.spi.support.AbstractCollectionDataAccess, org.hibernate.cache.spi.support.CollectionReadWriteAccess
Imports
org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.persister.collection.CollectionPersister

Contract for managing transactional and concurrent access to cached collection data. For cached collection data, all modification actions actually just invalidate the entry(s). The call sequence here is: lockItem -> remove -> unlockItem

There is another usage pattern that is used to invalidate entries afterQuery performing "bulk" HQL/SQL operations: lockRegion -> removeAll -> unlockRegion

Authors
Gavin King, Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a key which can be used to identify this collection on this same region
generateCacheKey
(Object
the primary identifier of the Collection
id
,
CollectionPersister
the descriptor of the collection for which a key is being generated
collectionDescriptor
,
SessionFactoryImplementor
a reference to the current SessionFactory
factory
,
String
the tenant id, or null if multi-tenancy is not being used.
tenantIdentifier
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
To create instances of CollectionCacheKey for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.
public Object

Returns:

original key passed to generateCacheKey
getCacheKeyId
(Object
key previously returned from generateCacheKey
cacheKey
)

Performs reverse operation to generateCacheKey

Inherited from org.hibernate.cache.spi.access.CachedDomainDataAccess:
containsevictevictAllgetgetAccessTypegetRegionlockItemlockRegionputFromLoadputFromLoadremoveremoveAllunlockItemunlockRegion

Method Detail

generateCacheKeyback to summary
public Object generateCacheKey(Object id, CollectionPersister collectionDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)

Deprecated

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

To create instances of CollectionCacheKey for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.

Parameters
id:Object

the primary identifier of the Collection

collectionDescriptor:CollectionPersister

the descriptor of the collection for which a key is being generated

factory:SessionFactoryImplementor

a reference to the current SessionFactory

tenantIdentifier:String

the tenant id, or null if multi-tenancy is not being used.

Returns:Object

a key which can be used to identify this collection on this same region

getCacheKeyIdback to summary
public Object getCacheKeyId(Object cacheKey)

Performs reverse operation to generateCacheKey

Parameters
cacheKey:Object

key previously returned from generateCacheKey

Returns:Object

original key passed to generateCacheKey