类 EntityReadWriteAccess
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
-
- org.hibernate.cache.spi.support.AbstractReadWriteAccess
-
- org.hibernate.cache.spi.support.EntityReadWriteAccess
-
public class EntityReadWriteAccess extends AbstractReadWriteAccess implements EntityDataAccess
Standard support forEntityDataAccessusing theAccessType.READ_WRITEaccess type.- 作者:
- Steve Ebersole
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.hibernate.cache.spi.support.AbstractReadWriteAccess
AbstractReadWriteAccess.Item, AbstractReadWriteAccess.Lockable, AbstractReadWriteAccess.SoftLockImpl
-
-
构造器概要
构造器 构造器 说明 EntityReadWriteAccess(DomainDataRegion domainDataRegion, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, EntityDataCachingConfig entityAccessConfig)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanafterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version)Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release().booleanafterUpdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)Called afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release().ObjectgenerateCacheKey(Object id, EntityPersister rootEntityDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)To create instances of keys for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.protected AccessedDataClassificationgetAccessedDataClassification()AccessTypegetAccessType()The type of access implementedObjectgetCacheKeyId(Object cacheKey)protected ComparatorgetVersionComparator()booleaninsert(SharedSessionContractImplementor session, Object key, Object value, Object version)Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict().SoftLocklockRegion()Lock the entire regionbooleanupdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion)Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict().-
从类继承的方法 org.hibernate.cache.spi.support.AbstractReadWriteAccess
decrementLock, get, handleLockExpiry, lockItem, nextLockId, putFromLoad, putFromLoad, readLock, remove, removeAll, unlockItem, uuid, writeLock
-
从类继承的方法 org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
clearCache, contains, destroy, evict, evictAll, getRegion, getStorageAccess, unlockRegion
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.cache.spi.access.CachedDomainDataAccess
contains, evict, evictAll, get, getRegion, lockItem, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
-
-
-
-
构造器详细资料
-
EntityReadWriteAccess
public EntityReadWriteAccess(DomainDataRegion domainDataRegion, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, EntityDataCachingConfig entityAccessConfig)
-
-
方法详细资料
-
getAccessType
public AccessType getAccessType()
从接口复制的说明:CachedDomainDataAccessThe type of access implemented- 指定者:
getAccessType在接口中CachedDomainDataAccess
-
getAccessedDataClassification
protected AccessedDataClassification getAccessedDataClassification()
-
getVersionComparator
protected Comparator getVersionComparator()
-
generateCacheKey
public Object generateCacheKey(Object id, EntityPersister rootEntityDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)
从接口复制的说明:EntityDataAccessTo create instances of keys for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.- 指定者:
generateCacheKey在接口中EntityDataAccess- 参数:
id- the primary identifier of the entityrootEntityDescriptor- Hierarchy 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 entity on this same region todo (6.0) : the access for an entity knows the entity hierarchy and the factory. why pass them in?
-
getCacheKeyId
public Object getCacheKeyId(Object cacheKey)
从接口复制的说明:EntityDataAccessPerforms reverse operation toEntityDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)- 指定者:
getCacheKeyId在接口中EntityDataAccess- 参数:
cacheKey- key previously returned fromEntityDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)- 返回:
- original id passed to
EntityDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)
-
insert
public boolean insert(SharedSessionContractImplementor session, Object key, Object value, Object version)
从接口复制的说明:EntityDataAccessCalled afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.- 指定者:
insert在接口中EntityDataAccess- 参数:
session- Current sessionkey- The item keyvalue- The itemversion- The item's version value- 返回:
- Were the contents of the cache actually changed by this operation?
-
afterInsert
public boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version)
从接口复制的说明:EntityDataAccessCalled afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.- 指定者:
afterInsert在接口中EntityDataAccess- 参数:
session- Current sessionkey- The item keyvalue- The itemversion- The item's version value- 返回:
- Were the contents of the cache actual changed by this operation?
-
update
public boolean update(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion)
从接口复制的说明:EntityDataAccessCalled afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.- 指定者:
update在接口中EntityDataAccess- 参数:
session- Current sessionkey- The item keyvalue- The itemcurrentVersion- The item's current version valuepreviousVersion- The item's previous version value- 返回:
- Were the contents of the cache actually changed by this operation?
-
afterUpdate
public boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
从接口复制的说明:EntityDataAccessCalled afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.- 指定者:
afterUpdate在接口中EntityDataAccess- 参数:
session- Current sessionkey- The item keyvalue- The itemcurrentVersion- The item's current version valuepreviousVersion- The item's previous version valuelock- The lock previously obtained fromCachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)- 返回:
- Were the contents of the cache actually changed by this operation?
-
lockRegion
public SoftLock lockRegion()
从接口复制的说明:CachedDomainDataAccessLock the entire region- 指定者:
lockRegion在接口中CachedDomainDataAccess- 覆盖:
lockRegion在类中AbstractCachedDomainDataAccess- 返回:
- A representation of our lock on the item; or
null.
-
-