public class EntityReadWriteAccess extends AbstractReadWriteAccess implements EntityDataAccess
EntityDataAccess
using the AccessType.READ_WRITE access type.AbstractReadWriteAccess.Item, AbstractReadWriteAccess.Lockable, AbstractReadWriteAccess.SoftLockImpl| Constructor and Description |
|---|
EntityReadWriteAccess(DomainDataRegion domainDataRegion,
CacheKeysFactory keysFactory,
DomainDataStorageAccess storageAccess,
EntityDataCachingConfig entityAccessConfig) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
afterInsert(SharedSessionContractImplementor session,
Object key,
Object value,
Object version)
Called afterQuery an item has been inserted (afterQuery the transaction completes),
instead of calling release().
|
boolean |
afterUpdate(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().
|
Object |
generateCacheKey(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 AccessedDataClassification |
getAccessedDataClassification() |
AccessType |
getAccessType()
The type of access implemented
|
Object |
getCacheKeyId(Object cacheKey)
|
protected Comparator |
getVersionComparator() |
boolean |
insert(SharedSessionContractImplementor session,
Object key,
Object value,
Object version)
Called afterQuery an item has been inserted (beforeQuery the transaction completes),
instead of calling evict().
|
SoftLock |
lockRegion()
Lock the entire region
|
boolean |
update(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().
|
decrementLock, get, handleLockExpiry, lockItem, nextLockId, putFromLoad, putFromLoad, readLock, remove, removeAll, unlockItem, uuid, writeLockclearCache, contains, destroy, evict, evictAll, getRegion, getStorageAccess, unlockRegionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontains, evict, evictAll, get, getRegion, lockItem, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegionpublic EntityReadWriteAccess(DomainDataRegion domainDataRegion, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, EntityDataCachingConfig entityAccessConfig)
public AccessType getAccessType()
CachedDomainDataAccessgetAccessType in interface CachedDomainDataAccessprotected AccessedDataClassification getAccessedDataClassification()
getAccessedDataClassification in class AbstractReadWriteAccessprotected Comparator getVersionComparator()
getVersionComparator in class AbstractReadWriteAccesspublic Object generateCacheKey(Object id, EntityPersister rootEntityDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)
EntityDataAccessgenerateCacheKey in interface EntityDataAccessid - 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.public Object getCacheKeyId(Object cacheKey)
EntityDataAccessEntityDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)getCacheKeyId in interface EntityDataAccesscacheKey - key previously returned from EntityDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)EntityDataAccess.generateCacheKey(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SessionFactoryImplementor, java.lang.String)public boolean insert(SharedSessionContractImplementor session, Object key, Object value, Object version)
EntityDataAccessinsert in interface EntityDataAccesssession - Current sessionkey - The item keyvalue - The itemversion - The item's version valuepublic boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version)
EntityDataAccessafterInsert in interface EntityDataAccesssession - Current sessionkey - The item keyvalue - The itemversion - The item's version valuepublic boolean update(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion)
EntityDataAccessupdate in interface EntityDataAccesssession - Current sessionkey - The item keyvalue - The itemcurrentVersion - The item's current version valuepreviousVersion - The item's previous version valuepublic boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
EntityDataAccessafterUpdate in interface EntityDataAccesssession - Current sessionkey - The item keyvalue - The itemcurrentVersion - The item's current version valuepreviousVersion - The item's previous version valuelock - The lock previously obtained from CachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)public SoftLock lockRegion()
CachedDomainDataAccesslockRegion in interface CachedDomainDataAccesslockRegion in class AbstractCachedDomainDataAccessnull.Copyright © 2001-2022 Red Hat, Inc. All Rights Reserved.