Class CoherenceReadWriteEntityAccess
java.lang.Object
com.oracle.coherence.hibernate.cache.v53.access.AbstractCoherenceEntityDataAccess
com.oracle.coherence.hibernate.cache.v53.access.CoherenceReadWriteEntityAccess
- All Implemented Interfaces:
org.hibernate.cache.spi.access.CachedDomainDataAccess
,org.hibernate.cache.spi.access.EntityDataAccess
public class CoherenceReadWriteEntityAccess
extends AbstractCoherenceEntityDataAccess
implements org.hibernate.cache.spi.access.EntityDataAccess
An CoherenceReadWriteEntityAccess is a Coherence-based read-write region access strategy
for Hibernate entity regions.
- Author:
- Randy Stafford, Gunnar Hillert
-
Field Summary
Fields inherited from class com.oracle.coherence.hibernate.cache.v53.access.AbstractCoherenceEntityDataAccess
TRANSACTIONAL_STRATEGY_NOT_SUPPORTED_MESSAGE, WRITE_OPERATIONS_NOT_SUPPORTED_MESSAGE
-
Constructor Summary
ConstructorDescriptionCoherenceReadWriteEntityAccess
(org.hibernate.cache.spi.DomainDataRegion domainDataRegion, org.hibernate.cache.spi.support.DomainDataStorageAccess domainDataStorageAccess, Comparator<?> versionComparator) Complete constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
afterInsert
(Object key, CoherenceRegionValue value) Coherence-based implementation of behavior common to: 1.boolean
afterInsert
(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version) protected boolean
afterUpdate
(Object key, CoherenceRegionValue value, org.hibernate.cache.spi.access.SoftLock softLock) Coherence-based implementation of behavior common to: 1.boolean
afterUpdate
(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.spi.access.SoftLock lock) boolean
generateCacheKey
(Object id, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor, String tenantIdentifier) org.hibernate.cache.spi.access.AccessType
getCacheKeyId
(Object cacheKey) boolean
insert
(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version) org.hibernate.cache.spi.access.SoftLock
lockItem
(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object version) boolean
putFromLoad
(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride) void
unlockItem
(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, org.hibernate.cache.spi.access.SoftLock lock) boolean
Methods inherited from class com.oracle.coherence.hibernate.cache.v53.access.AbstractCoherenceEntityDataAccess
evict, evictAll, getCacheKeysFactory, getCoherenceRegion, getDomainDataStorageAccess, getRegion, getUuid, getVersionComparator, lockRegion, newCacheValue, nextSoftLockSequenceNumber, putFromLoad, remove, removeAll, toString, unlockRegion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.cache.spi.access.CachedDomainDataAccess
evict, evictAll, get, getRegion, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
-
Constructor Details
-
CoherenceReadWriteEntityAccess
public CoherenceReadWriteEntityAccess(org.hibernate.cache.spi.DomainDataRegion domainDataRegion, org.hibernate.cache.spi.support.DomainDataStorageAccess domainDataStorageAccess, Comparator<?> versionComparator) Complete constructor.- Parameters:
domainDataRegion
- the domain data regiondomainDataStorageAccess
- the domain data storage accessversionComparator
- the version comparator
-
-
Method Details
-
generateCacheKey
public Object generateCacheKey(Object id, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor, String tenantIdentifier) - Specified by:
generateCacheKey
in interfaceorg.hibernate.cache.spi.access.EntityDataAccess
-
getCacheKeyId
- Specified by:
getCacheKeyId
in interfaceorg.hibernate.cache.spi.access.EntityDataAccess
-
getAccessType
public org.hibernate.cache.spi.access.AccessType getAccessType()- Specified by:
getAccessType
in interfaceorg.hibernate.cache.spi.access.CachedDomainDataAccess
-
contains
- Specified by:
contains
in interfaceorg.hibernate.cache.spi.access.CachedDomainDataAccess
- Overrides:
contains
in classAbstractCoherenceEntityDataAccess
-
afterInsert
Coherence-based implementation of behavior common to: 1. org.hibernate.cache.spi.access.EntityRegionAccessStrategy.afterInsert(Object key, Object value, Object version) and 2. org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy.afterInsert(Object key, Object value). The only difference in implementation is that the cache value in a NaturalIdRegion will have a null version object.- Parameters:
key
- the key at which to insert a valuevalue
- the value to insert- Returns:
- a boolean indicating whether cache contents were modified
-
afterUpdate
protected boolean afterUpdate(Object key, CoherenceRegionValue value, org.hibernate.cache.spi.access.SoftLock softLock) Coherence-based implementation of behavior common to: 1. org.hibernate.cache.spi.access.EntityRegionAccessStrategy.afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) and 2. org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy.afterUpdate(Object key, Object value, SoftLock lock). The only difference in implementation is that the cache value in a NaturalIdRegion will have a null version object.- Parameters:
key
- the key at which to insert a valuevalue
- the value to insertsoftLock
- the softLock acquired in an earlier lockItem call with the argument key- Returns:
- a boolean indicating whether cache contents were modified