public abstract class AbstractNaturalIdDataAccess extends AbstractCachedDomainDataAccess implements NaturalIdDataAccess
| Constructor and Description |
|---|
AbstractNaturalIdDataAccess(DomainDataRegion region,
CacheKeysFactory keysFactory,
DomainDataStorageAccess storageAccess,
NaturalIdDataCachingConfig config) |
| 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 persister,
SharedSessionContractImplementor session)
To create instances of NaturalIdCacheKey for this region, Hibernate will invoke this method
exclusively so that generated implementations can generate optimised keys.
|
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. |
boolean |
insert(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been inserted (beforeQuery the transaction completes),
instead of calling evict().
|
SoftLock |
lockItem(SharedSessionContractImplementor session,
Object key,
Object version)
We are going to attempt to update/delete the keyed object.
|
SoftLock |
lockRegion()
Lock the entire region
|
void |
unlockItem(SharedSessionContractImplementor session,
Object key,
SoftLock lock)
Called when we have finished the attempted update/delete (which may or
may not have been successful), after transaction completion.
|
void |
unlockRegion(SoftLock lock)
Called after we have finished the attempted invalidation of the entire
region
|
boolean |
update(SharedSessionContractImplementor session,
Object key,
Object value)
Called afterQuery an item has been updated (beforeQuery the transaction completes),
instead of calling evict().
|
clearCache, contains, destroy, evict, evictAll, get, getRegion, getStorageAccess, putFromLoad, putFromLoad, remove, removeAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontains, evict, evictAll, get, getAccessType, getRegion, putFromLoad, putFromLoad, remove, removeAllpublic AbstractNaturalIdDataAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig config)
public Object generateCacheKey(Object[] naturalIdValues, EntityPersister persister, SharedSessionContractImplementor session)
NaturalIdDataAccessTo create instances of NaturalIdCacheKey for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.
generateCacheKey in interface NaturalIdDataAccessnaturalIdValues - the sequence of values which unequivocally identifies a cached element on this regionpersister - the persister of the element being cachedpublic Object[] getNaturalIdValues(Object cacheKey)
NaturalIdDataAccessPerforms reverse operation to NaturalIdDataAccess.generateCacheKey(java.lang.Object[], org.hibernate.persister.entity.EntityPersister, org.hibernate.engine.spi.SharedSessionContractImplementor), returning
the original naturalIdValues.
getNaturalIdValues in interface NaturalIdDataAccesscacheKey - 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)
NaturalIdDataAccessCalled afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
insert in interface NaturalIdDataAccesssession - Current sessionkey - The item keyvalue - The itempublic boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccessCalled afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
afterInsert in interface NaturalIdDataAccesssession - Current sessionkey - The item keyvalue - The itempublic boolean update(SharedSessionContractImplementor session, Object key, Object value)
NaturalIdDataAccessCalled afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
update in interface NaturalIdDataAccesssession - Current sessionkey - The item keyvalue - The itempublic boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, SoftLock lock)
NaturalIdDataAccessCalled afterQuery an item has been updated (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
afterUpdate in interface NaturalIdDataAccesssession - 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)public SoftLock lockRegion()
CachedDomainDataAccessLock the entire region
lockRegion in interface CachedDomainDataAccesslockRegion in class AbstractCachedDomainDataAccessnull.public void unlockRegion(SoftLock lock)
CachedDomainDataAccessCalled after we have finished the attempted invalidation of the entire region
unlockRegion in interface CachedDomainDataAccessunlockRegion in class AbstractCachedDomainDataAccesslock - The lock previously obtained from CachedDomainDataAccess.lockRegion()public SoftLock lockItem(SharedSessionContractImplementor session, Object key, Object version)
CachedDomainDataAccessWe are going to attempt to update/delete the keyed object. This
method is used by "asynchronous" concurrency strategies.
<p/>
The returned object must be passed back to CachedDomainDataAccess.unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, org.hibernate.cache.spi.access.SoftLock), to release the
lock. Concurrency strategies which do not support client-visible
locks may silently return null.
lockItem in interface CachedDomainDataAccesssession - Current session.key - The key of the item to lockversion - The item’s current version valuenull.public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)
CachedDomainDataAccessCalled when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.
unlockItem in interface CachedDomainDataAccesssession - Current session.key - The item keylock - The lock previously obtained from CachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.