public interface CollectionDataAccess extends CachedDomainDataAccess
CachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
-> CachedDomainDataAccess.remove(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
-> CachedDomainDataAccess.unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, org.hibernate.cache.spi.access.SoftLock)
There is another usage pattern that is used to invalidate entries
afterQuery performing "bulk" HQL/SQL operations:
CachedDomainDataAccess.lockRegion()
-> CachedDomainDataAccess.removeAll(org.hibernate.engine.spi.SharedSessionContractImplementor)
-> CachedDomainDataAccess.unlockRegion(org.hibernate.cache.spi.access.SoftLock)
Modifier and Type | Method and Description |
---|---|
Object |
generateCacheKey(Object id,
CollectionPersister collectionDescriptor,
SessionFactoryImplementor factory,
String tenantIdentifier)
To create instances of CollectionCacheKey for this region, Hibernate will invoke this method
exclusively so that generated implementations can generate optimised keys.
|
Object |
getCacheKeyId(Object cacheKey)
|
contains, evict, evictAll, get, getAccessType, getRegion, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
Object generateCacheKey(Object id, CollectionPersister collectionDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)
id
- the primary identifier of the CollectioncollectionDescriptor
- the descriptor of the collection for which a key is being generatedfactory
- a reference to the current SessionFactorytenantIdentifier
- the tenant id, or null if multi-tenancy is not being used.Object getCacheKeyId(Object cacheKey)
generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)
cacheKey
- key previously returned from generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)
generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)
Copyright © 2019 JBoss by Red Hat. All rights reserved.