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 forNaturalIdDataAccess
using theAccessType.NONSTRICT_READ_WRITE
access 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 boolean
afterInsert(SharedSessionContractImplementor session, Object key, Object value)
Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release().AccessType
getAccessType()
The type of access implementedboolean
insert(SharedSessionContractImplementor session, Object key, Object value)
Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict().void
remove(SharedSessionContractImplementor session, Object key)
Called afterQuery an item has become stale (beforeQuery the transaction completes).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.boolean
update(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 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:CachedDomainDataAccess
The type of access implemented
-
unlockItem
public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)
Description copied from interface:CachedDomainDataAccess
Called 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:
unlockItem
in interfaceCachedDomainDataAccess
- Overrides:
unlockItem
in 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, Object key)
Description copied from interface:CachedDomainDataAccess
Called afterQuery an item has become stale (beforeQuery the transaction completes). This method is used by "synchronous" concurrency strategies.- Specified by:
remove
in interfaceCachedDomainDataAccess
- Overrides:
remove
in classAbstractCachedDomainDataAccess
- Parameters:
session
- Current session.key
- The key of the item to remove
-
insert
public boolean insert(SharedSessionContractImplementor session, Object key, Object value)
Description copied from interface:NaturalIdDataAccess
Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.- Specified by:
insert
in interfaceNaturalIdDataAccess
- Overrides:
insert
in 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, Object key, Object value)
Description copied from interface:NaturalIdDataAccess
Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.- Specified by:
afterInsert
in interfaceNaturalIdDataAccess
- Overrides:
afterInsert
in 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, Object key, Object value)
Description copied from interface:NaturalIdDataAccess
Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.- Specified by:
update
in interfaceNaturalIdDataAccess
- Overrides:
update
in classAbstractNaturalIdDataAccess
- Parameters:
session
- Current sessionkey
- The item keyvalue
- The item- Returns:
- Were the contents of the cache actually changed by this operation?
-
-