类 AbstractCachedDomainDataAccess
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
-
- 直接已知子类:
AbstractCollectionDataAccess,AbstractEntityDataAccess,AbstractNaturalIdDataAccess,AbstractReadWriteAccess
public abstract class AbstractCachedDomainDataAccess extends Object implements CachedDomainDataAccess, AbstractDomainDataRegion.Destructible
- 作者:
- Steve Ebersole
-
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractCachedDomainDataAccess(DomainDataRegion region, DomainDataStorageAccess storageAccess)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidclearCache()booleancontains(Object key)Determine whether this region contains data for the given key.voiddestroy()voidevict(Object key)Forcibly evict an item from the cache immediately without regard for transaction isolation and/or locking.voidevictAll()Forcibly evict all items from the cache immediately without regard for transaction isolation.Objectget(SharedSessionContractImplementor session, Object key)Attempt to retrieve an object from the cache.DomainDataRegiongetRegion()The region containing the data being accessedprotected DomainDataStorageAccessgetStorageAccess()SoftLocklockRegion()Lock the entire regionbooleanputFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version)Attempt to cache an object, afterQuery loading from the database.booleanputFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride)Attempt to cache an object, afterQuery loading from the database, explicitly specifying the minimalPut behavior.voidremove(SharedSessionContractImplementor session, Object key)Called afterQuery an item has become stale (beforeQuery the transaction completes).voidremoveAll(SharedSessionContractImplementor session)Remove all data for this accessed typevoidunlockRegion(SoftLock lock)Called after we have finished the attempted invalidation of the entire region-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.cache.spi.access.CachedDomainDataAccess
getAccessType, lockItem, unlockItem
-
-
-
-
构造器详细资料
-
AbstractCachedDomainDataAccess
protected AbstractCachedDomainDataAccess(DomainDataRegion region, DomainDataStorageAccess storageAccess)
-
-
方法详细资料
-
getRegion
public DomainDataRegion getRegion()
从接口复制的说明:CachedDomainDataAccessThe region containing the data being accessed- 指定者:
getRegion在接口中CachedDomainDataAccess
-
getStorageAccess
protected DomainDataStorageAccess getStorageAccess()
-
clearCache
protected void clearCache()
-
contains
public boolean contains(Object key)
从接口复制的说明:CachedDomainDataAccessDetermine whether this region contains data for the given key. The semantic here is whether the cache contains data visible for the current call context. This should be viewed as a "best effort", meaning blocking should be avoided if possible.- 指定者:
contains在接口中CachedDomainDataAccess- 参数:
key- The cache key- 返回:
- True if the underlying cache contains corresponding data; false otherwise.
-
get
public Object get(SharedSessionContractImplementor session, Object key)
从接口复制的说明:CachedDomainDataAccessAttempt to retrieve an object from the cache. Mainly used in attempting to resolve entities/collections from the second level cache.- 指定者:
get在接口中CachedDomainDataAccess- 参数:
session- Current session.key- The key of the item to be retrieved.- 返回:
- the cached data or
null
-
putFromLoad
public boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version)
从接口复制的说明:CachedDomainDataAccessAttempt to cache an object, afterQuery loading from the database.- 指定者:
putFromLoad在接口中CachedDomainDataAccess- 参数:
session- Current session.key- The item keyvalue- The itemversion- the item version number- 返回:
trueif the object was successfully cached
-
putFromLoad
public boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride)
从接口复制的说明:CachedDomainDataAccessAttempt to cache an object, afterQuery loading from the database, explicitly specifying the minimalPut behavior.- 指定者:
putFromLoad在接口中CachedDomainDataAccess- 参数:
session- Current session.key- The item keyvalue- The itemversion- the item version numberminimalPutOverride- Explicit minimalPut flag- 返回:
trueif the object was successfully cached
-
lockRegion
public SoftLock lockRegion()
从接口复制的说明:CachedDomainDataAccessLock the entire region- 指定者:
lockRegion在接口中CachedDomainDataAccess- 返回:
- 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- 参数:
lock- The lock previously obtained fromCachedDomainDataAccess.lockRegion()
-
remove
public void remove(SharedSessionContractImplementor session, Object key)
从接口复制的说明:CachedDomainDataAccessCalled afterQuery an item has become stale (beforeQuery the transaction completes). This method is used by "synchronous" concurrency strategies.- 指定者:
remove在接口中CachedDomainDataAccess- 参数:
session- Current session.key- The key of the item to remove
-
removeAll
public void removeAll(SharedSessionContractImplementor session)
从接口复制的说明:CachedDomainDataAccessRemove all data for this accessed type- 指定者:
removeAll在接口中CachedDomainDataAccess
-
evict
public void evict(Object key)
从接口复制的说明:CachedDomainDataAccessForcibly evict an item from the cache immediately without regard for transaction isolation and/or locking. This behavior is exactly Hibernate legacy behavior, but it is also required by JPA - so we cannot remove it. Used from JPA'sCache.evict(Class, Object), as well as the Hibernate extensionCache.evictEntityData(Class, Serializable)andCache.evictEntityData(String, Serializable)- 指定者:
evict在接口中CachedDomainDataAccess- 参数:
key- The key of the item to remove
-
evictAll
public void evictAll()
从接口复制的说明:CachedDomainDataAccessForcibly evict all items from the cache immediately without regard for transaction isolation. This behavior is exactly Hibernate legacy behavior, but it is also required by JPA - so we cannot remove it. Used from our JPA impl ofCache.evictAll()as well as the Hibernate extensionsCache.evictEntityData(Class),Cache.evictEntityData(String)andCache.evictEntityData()- 指定者:
evictAll在接口中CachedDomainDataAccess
-
destroy
public void destroy()
- 指定者:
destroy在接口中AbstractDomainDataRegion.Destructible
-
-