Package org.hibernate.cache.spi.support
Class NaturalIdNonStrictReadWriteAccess
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
-
- org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess
-
- org.hibernate.cache.spi.support.NaturalIdNonStrictReadWriteAccess
-
- All Implemented Interfaces:
CachedDomainDataAccess,NaturalIdDataAccess,AbstractDomainDataRegion.Destructible
public class NaturalIdNonStrictReadWriteAccess extends AbstractNaturalIdDataAccess
Standard support forNaturalIdDataAccessusing theAccessType.NONSTRICT_READ_WRITEaccess type.
-
-
Constructor Summary
Constructors Constructor Description NaturalIdNonStrictReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanafterInsert(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value)Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release().AccessTypegetAccessType()The type of access implementedbooleaninsert(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value)Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict().voidremove(SharedSessionContractImplementor session, java.lang.Object key)Called afterQuery an item has become stale (beforeQuery the transaction completes).voidunlockItem(SharedSessionContractImplementor session, java.lang.Object key, SoftLock lock)Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.booleanupdate(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value)Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict().-
Methods inherited from class org.hibernate.cache.spi.support.AbstractNaturalIdDataAccess
afterUpdate, generateCacheKey, getNaturalIdValues, lockItem, lockRegion, unlockRegion
-
Methods inherited from class org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
clearCache, contains, destroy, evict, evictAll, get, getRegion, getStorageAccess, putFromLoad, putFromLoad, removeAll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.cache.spi.access.CachedDomainDataAccess
contains, evict, evictAll, get, getRegion, putFromLoad, putFromLoad, removeAll
-
-
-
-
Constructor Detail
-
NaturalIdNonStrictReadWriteAccess
public NaturalIdNonStrictReadWriteAccess(DomainDataRegion region, CacheKeysFactory keysFactory, DomainDataStorageAccess storageAccess, NaturalIdDataCachingConfig config)
-
-
Method Detail
-
getAccessType
public AccessType getAccessType()
Description copied from interface:CachedDomainDataAccessThe type of access implemented
-
unlockItem
public void unlockItem(SharedSessionContractImplementor session, java.lang.Object key, SoftLock lock)
Description copied from interface: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.- Specified by:
unlockItemin interfaceCachedDomainDataAccess- Overrides:
unlockItemin classAbstractNaturalIdDataAccess- Parameters:
session- Current session.key- The item keylock- The lock previously obtained fromCachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
-
remove
public void remove(SharedSessionContractImplementor session, java.lang.Object key)
Description copied from interface:CachedDomainDataAccessCalled afterQuery an item has become stale (beforeQuery the transaction completes). This method is used by "synchronous" concurrency strategies.- Specified by:
removein interfaceCachedDomainDataAccess- Overrides:
removein classAbstractCachedDomainDataAccess- Parameters:
session- Current session.key- The key of the item to remove
-
insert
public boolean insert(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value)
Description copied from interface:NaturalIdDataAccessCalled afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.- Specified by:
insertin interfaceNaturalIdDataAccess- Overrides:
insertin classAbstractNaturalIdDataAccess- Parameters:
session- Current sessionkey- The item keyvalue- The item- Returns:
- Were the contents of the cache actually changed by this operation?
-
afterInsert
public boolean afterInsert(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value)
Description copied from interface:NaturalIdDataAccessCalled afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.- Specified by:
afterInsertin interfaceNaturalIdDataAccess- Overrides:
afterInsertin classAbstractNaturalIdDataAccess- Parameters:
session- Current sessionkey- The item keyvalue- The item- Returns:
- Were the contents of the cache actually changed by this operation?
-
update
public boolean update(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value)
Description copied from interface:NaturalIdDataAccessCalled afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.- Specified by:
updatein interfaceNaturalIdDataAccess- Overrides:
updatein classAbstractNaturalIdDataAccess- Parameters:
session- Current sessionkey- The item keyvalue- The item- Returns:
- Were the contents of the cache actually changed by this operation?
-
-