Class NaturalIdReadWriteAccess
java.lang.Object
org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
org.hibernate.cache.spi.support.AbstractReadWriteAccess
org.hibernate.cache.spi.support.NaturalIdReadWriteAccess
- All Implemented Interfaces:
CachedDomainDataAccess, NaturalIdDataAccess, AbstractDomainDataRegion.Destructible
public class NaturalIdReadWriteAccess
extends AbstractReadWriteAccess
implements NaturalIdDataAccess
Standard support for
NaturalIdDataAccess
using the AccessType.READ_WRITE access type.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractReadWriteAccess
AbstractReadWriteAccess.Item, AbstractReadWriteAccess.Lockable, AbstractReadWriteAccess.SoftLockImpl -
Constructor Summary
ConstructorsConstructorDescriptionNaturalIdReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig naturalIdDataCachingConfig) -
Method Summary
Modifier and TypeMethodDescriptionbooleanafterInsert(SharedSessionContractImplementor session, Object key, Object value) Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release().booleanafterUpdate(SharedSessionContractImplementor session, Object key, Object value, SoftLock lock) Called afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release().generateCacheKey(Object naturalIdValues, EntityPersister rootEntityDescriptor, SharedSessionContractImplementor session) To create instances of NaturalIdCacheKey for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.protected AccessedDataClassificationThe type of access implementedgetNaturalIdValues(Object cacheKey) Performs reverse operation toNaturalIdDataAccess.generateCacheKey(Object, EntityPersister, SharedSessionContractImplementor), returning the original naturalIdValues.protected Comparator<?> booleaninsert(SharedSessionContractImplementor session, Object key, Object value) Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict().booleanupdate(SharedSessionContractImplementor session, Object key, Object value) Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict().Methods inherited from class AbstractReadWriteAccess
decrementLock, get, handleLockExpiry, lockItem, nextLockId, putFromLoad, putFromLoad, readLock, remove, removeAll, unlockItem, uuid, writeLockMethods inherited from class AbstractCachedDomainDataAccess
clearCache, contains, destroy, evict, evictAll, getRegion, getStorageAccess, lockRegion, unlockRegionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CachedDomainDataAccess
contains, evict, evictAll, get, getRegion, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
-
Constructor Details
-
NaturalIdReadWriteAccess
public NaturalIdReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig naturalIdDataCachingConfig)
-
-
Method Details
-
getAccessedDataClassification
- Specified by:
getAccessedDataClassificationin classAbstractReadWriteAccess
-
getAccessType
Description copied from interface:CachedDomainDataAccessThe type of access implemented- Specified by:
getAccessTypein interfaceCachedDomainDataAccess
-
getVersionComparator
- Specified by:
getVersionComparatorin classAbstractReadWriteAccess
-
getNaturalIdValues
Description copied from interface:NaturalIdDataAccessPerforms reverse operation toNaturalIdDataAccess.generateCacheKey(Object, EntityPersister, SharedSessionContractImplementor), returning the original naturalIdValues.- Specified by:
getNaturalIdValuesin interfaceNaturalIdDataAccess- Parameters:
cacheKey- key returned fromNaturalIdDataAccess.generateCacheKey(Object, EntityPersister, SharedSessionContractImplementor)- Returns:
- the sequence of values which unequivocally identifies a cached element on this region
-