类 AbstractCollectionDataAccess
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
-
- org.hibernate.cache.spi.support.AbstractCollectionDataAccess
-
public abstract class AbstractCollectionDataAccess extends AbstractCachedDomainDataAccess implements CollectionDataAccess
- 作者:
- Steve Ebersole
-
-
构造器概要
构造器 构造器 说明 AbstractCollectionDataAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, CollectionDataCachingConfig config)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ObjectgenerateCacheKey(Object id, CollectionPersister persister, 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)SoftLocklockItem(SharedSessionContractImplementor session, Object key, Object version)We are going to attempt to update/delete the keyed object.SoftLocklockRegion()Lock the entire regionvoidunlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.voidunlockRegion(SoftLock lock)Called after we have finished the attempted invalidation of the entire region-
从类继承的方法 org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
clearCache, contains, destroy, evict, evictAll, get, getRegion, getStorageAccess, putFromLoad, putFromLoad, remove, removeAll
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.cache.spi.access.CachedDomainDataAccess
contains, evict, evictAll, get, getAccessType, getRegion, putFromLoad, putFromLoad, remove, removeAll
-
-
-
-
构造器详细资料
-
AbstractCollectionDataAccess
public AbstractCollectionDataAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, CollectionDataCachingConfig config)
-
-
方法详细资料
-
generateCacheKey
public Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier)
从接口复制的说明:CollectionDataAccessTo create instances of CollectionCacheKey for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.- 指定者:
generateCacheKey在接口中CollectionDataAccess- 参数:
id- the primary identifier of the Collectionpersister- 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
public Object getCacheKeyId(Object cacheKey)
从接口复制的说明:CollectionDataAccessPerforms reverse operation toCollectionDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)- 指定者:
getCacheKeyId在接口中CollectionDataAccess- 参数:
cacheKey- key previously returned fromCollectionDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)- 返回:
- original key passed to
CollectionDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.collection.CollectionPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)
-
lockItem
public SoftLock lockItem(SharedSessionContractImplementor session, Object key, Object version)
从接口复制的说明:CachedDomainDataAccessWe are going to attempt to update/delete the keyed object. This method is used by "asynchronous" concurrency strategies. The returned object must be passed back toCachedDomainDataAccess.unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, org.hibernate.cache.spi.access.SoftLock), to release the lock. Concurrency strategies which do not support client-visible locks may silently return null.- 指定者:
lockItem在接口中CachedDomainDataAccess- 参数:
session- Current session.key- The key of the item to lockversion- The item's current version value- 返回:
- A representation of our lock on the item; or
null.
-
unlockItem
public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)
从接口复制的说明:CachedDomainDataAccessCalled when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.- 指定者:
unlockItem在接口中CachedDomainDataAccess- 参数:
session- Current session.key- The item keylock- The lock previously obtained fromCachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
-
lockRegion
public SoftLock lockRegion()
从接口复制的说明:CachedDomainDataAccessLock the entire region- 指定者:
lockRegion在接口中CachedDomainDataAccess- 覆盖:
lockRegion在类中AbstractCachedDomainDataAccess- 返回:
- A representation of our lock on the item; or
null.
-
unlockRegion
public void unlockRegion(SoftLock lock)
从接口复制的说明:CachedDomainDataAccessCalled after we have finished the attempted invalidation of the entire region- 指定者:
unlockRegion在接口中CachedDomainDataAccess- 覆盖:
unlockRegion在类中AbstractCachedDomainDataAccess- 参数:
lock- The lock previously obtained fromCachedDomainDataAccess.lockRegion()
-
-