Class CoherenceReadWriteNaturalIdAccess

java.lang.Object
com.oracle.coherence.hibernate.cache.v53.access.AbstractCoherenceEntityDataAccess
com.oracle.coherence.hibernate.cache.v53.access.CoherenceReadWriteNaturalIdAccess
All Implemented Interfaces:
org.hibernate.cache.spi.access.CachedDomainDataAccess, org.hibernate.cache.spi.access.NaturalIdDataAccess

public class CoherenceReadWriteNaturalIdAccess extends AbstractCoherenceEntityDataAccess implements org.hibernate.cache.spi.access.NaturalIdDataAccess
A CoherenceReadWriteNaturalIdAccess is a Coherence-based read-write region access strategy for Hibernate natural ID regions.
Author:
Randy Stafford, Gunnar Hillert
  • Constructor Details

    • CoherenceReadWriteNaturalIdAccess

      public CoherenceReadWriteNaturalIdAccess(org.hibernate.cache.spi.DomainDataRegion domainDataRegion, org.hibernate.cache.spi.support.DomainDataStorageAccess domainDataStorageAccess)
      Complete constructor.
      Parameters:
      domainDataRegion - the domain data region
      domainDataStorageAccess - the domain data storage access
  • Method Details

    • insert

      public boolean insert(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value) throws org.hibernate.cache.CacheException
      Specified by:
      insert in interface org.hibernate.cache.spi.access.NaturalIdDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • afterInsert

      public boolean afterInsert(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value) throws org.hibernate.cache.CacheException
      Specified by:
      afterInsert in interface org.hibernate.cache.spi.access.NaturalIdDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • update

      public boolean update(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value) throws org.hibernate.cache.CacheException
      Specified by:
      update in interface org.hibernate.cache.spi.access.NaturalIdDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • afterUpdate

      public boolean afterUpdate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, org.hibernate.cache.spi.access.SoftLock lock) throws org.hibernate.cache.CacheException
      Specified by:
      afterUpdate in interface org.hibernate.cache.spi.access.NaturalIdDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • generateCacheKey

      public Object generateCacheKey(Object[] naturalIdValues, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.spi.SharedSessionContractImplementor session)
    • getNaturalIdValues

      public Object[] getNaturalIdValues(Object cacheKey)
      Specified by:
      getNaturalIdValues in interface org.hibernate.cache.spi.access.NaturalIdDataAccess
    • getAccessType

      public org.hibernate.cache.spi.access.AccessType getAccessType()
      Specified by:
      getAccessType in interface org.hibernate.cache.spi.access.CachedDomainDataAccess
    • contains

      public boolean contains(Object key)
      Specified by:
      contains in interface org.hibernate.cache.spi.access.CachedDomainDataAccess
      Overrides:
      contains in class AbstractCoherenceEntityDataAccess
    • get

      public Object get(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key) throws org.hibernate.cache.CacheException
      Overrides:
      get in class AbstractCoherenceEntityDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • lockItem

      public org.hibernate.cache.spi.access.SoftLock lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object version) throws org.hibernate.cache.CacheException
      Overrides:
      lockItem in class AbstractCoherenceEntityDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • putFromLoad

      public boolean putFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride) throws org.hibernate.cache.CacheException
      Overrides:
      putFromLoad in class AbstractCoherenceEntityDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • unlockItem

      public void unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, org.hibernate.cache.spi.access.SoftLock lock) throws org.hibernate.cache.CacheException
      Overrides:
      unlockItem in class AbstractCoherenceEntityDataAccess
      Throws:
      org.hibernate.cache.CacheException
    • afterInsert

      protected boolean afterInsert(Object key, CoherenceRegionValue value)
      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 value
      value - 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 value
      value - the value to insert
      softLock - the softLock acquired in an earlier lockItem call with the argument key
      Returns:
      a boolean indicating whether cache contents were modified