public class NaturalIdReadWriteAccess extends AbstractReadWriteAccess implements NaturalIdDataAccess
NaturalIdDataAccess
using the AccessType.READ_WRITE
access type.AbstractReadWriteAccess.Item, AbstractReadWriteAccess.Lockable, AbstractReadWriteAccess.SoftLockImpl
Constructor and Description |
---|
NaturalIdReadWriteAccess(DomainDataRegion region,
CacheKeysFactory keysFactory,
DomainDataStorageAccess storageAccess,
NaturalIdDataCachingConfig naturalIdDataCachingConfig) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterInsert(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been inserted (afterQuery the transaction completes),
instead of calling release().
|
boolean |
afterUpdate(SharedSessionContractImplementor session,
Object key,
Object value,
SoftLock lock)
Called afterQuery an item has been updated (afterQuery the transaction completes),
instead of calling release().
|
Object |
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 AccessedDataClassification |
getAccessedDataClassification() |
AccessType |
getAccessType()
The type of access implemented
|
Object[] |
getNaturalIdValues(Object cacheKey)
Performs reverse operation to
NaturalIdDataAccess.generateCacheKey(java.lang.Object[], org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SharedSessionContractImplementor) , returning
the original naturalIdValues. |
protected Comparator |
getVersionComparator() |
boolean |
insert(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been inserted (beforeQuery the transaction completes),
instead of calling evict().
|
boolean |
update(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been updated (beforeQuery the transaction completes),
instead of calling evict().
|
decrementLock, get, handleLockExpiry, lockItem, nextLockId, putFromLoad, putFromLoad, readLock, remove, unlockItem, uuid, writeLock
clearCache, contains, destroy, evict, evictAll, getRegion, getStorageAccess, lockRegion, removeAll, unlockRegion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, evict, evictAll, get, getRegion, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
public NaturalIdReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig naturalIdDataCachingConfig)
protected AccessedDataClassification getAccessedDataClassification()
getAccessedDataClassification
in class AbstractReadWriteAccess
public AccessType getAccessType()
CachedDomainDataAccess
getAccessType
in interface CachedDomainDataAccess
protected Comparator getVersionComparator()
getVersionComparator
in class AbstractReadWriteAccess
public Object generateCacheKey(Object[] naturalIdValues, EntityPersister rootEntityDescriptor, SharedSessionContractImplementor session)
NaturalIdDataAccess
generateCacheKey
in interface NaturalIdDataAccess
naturalIdValues
- the sequence of values which unequivocally identifies a cached element on this regionrootEntityDescriptor
- the persister of the element being cachedpublic Object[] getNaturalIdValues(Object cacheKey)
NaturalIdDataAccess
NaturalIdDataAccess.generateCacheKey(java.lang.Object[], org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SharedSessionContractImplementor)
, returning
the original naturalIdValues.getNaturalIdValues
in interface NaturalIdDataAccess
cacheKey
- key returned from NaturalIdDataAccess.generateCacheKey(java.lang.Object[], org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SharedSessionContractImplementor)
public boolean insert(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccess
insert
in interface NaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itempublic boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccess
afterInsert
in interface NaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itempublic boolean update(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccess
update
in interface NaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itempublic boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, SoftLock lock)
NaturalIdDataAccess
afterUpdate
in interface NaturalIdDataAccess
session
- Current sessionkey
- The item keyvalue
- The itemlock
- The lock previously obtained from CachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
Copyright © 2021 JBoss by Red Hat. All rights reserved.