接口 CollectionDataAccess
-
- 所有超级接口:
CachedDomainDataAccess
- 所有已知实现类:
AbstractCollectionDataAccess,CollectionNonStrictReadWriteAccess,CollectionReadOnlyAccess,CollectionReadWriteAccess,CollectionTransactionAccess
public interface CollectionDataAccess extends CachedDomainDataAccess
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: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)- 作者:
- Gavin King, Steve Ebersole
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ObjectgenerateCacheKey(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.ObjectgetCacheKeyId(Object cacheKey)-
从接口继承的方法 org.hibernate.cache.spi.access.CachedDomainDataAccess
contains, evict, evictAll, get, getAccessType, getRegion, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
-
-
-
-
方法详细资料
-
generateCacheKey
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.- 参数:
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.- 返回:
- a key which can be used to identify this collection on this same region
-
getCacheKeyId
Object getCacheKeyId(Object cacheKey)
Performs reverse operation togenerateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)- 参数:
cacheKey- key previously returned fromgenerateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)- 返回:
- original key passed to
generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)
-
-