Interface EntityDataAccess

All Superinterfaces:
CachedDomainDataAccess
All Known Implementing Classes:
AbstractEntityDataAccess, EntityNonStrictReadWriteAccess, EntityReadOnlyAccess, EntityReadWriteAccess, EntityTransactionalAccess

  • Method Details

    • generateCacheKey

      Object generateCacheKey(Object id, EntityPersister rootEntityDescriptor, SessionFactoryImplementor factory, String tenantIdentifier)
      To create instances of keys for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.
      Parameters:
      id - the primary identifier of the entity
      rootEntityDescriptor - Hierarchy for which a key is being generated
      factory - a reference to the current SessionFactory
      tenantIdentifier - the tenant id, or null if multi-tenancy is not being used.
      Returns:
      a key which can be used to identify this entity on this same region todo (6.0) : the access for an entity knows the entity hierarchy and the factory. why pass them in?
    • getCacheKeyId

    • insert

      boolean insert(SharedSessionContractImplementor session, Object key, Object value, Object version)
      Called after an item has been inserted (before the transaction completes), instead of calling CachedDomainDataAccess.evict(Object). This method is used by "synchronous" concurrency strategies.
      Parameters:
      session - Current session
      key - The item key
      value - The item
      version - The item's version value
      Returns:
      Were the contents of the cache actually changed by this operation?
      Throws:
      CacheException - Propagated from underlying cache provider
    • afterInsert

      boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version)
      Called after an item has been inserted (after the transaction completes), instead of calling
      invalid reference
      #release
      . This method is used by "asynchronous" concurrency strategies.
      Parameters:
      session - Current session
      key - The item key
      value - The item
      version - The item's version value
      Returns:
      Were the contents of the cache actual changed by this operation?
      Throws:
      CacheException - Propagated from underlying cache provider
    • update

      boolean update(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion)
      Called after an item has been updated (before the transaction completes), instead of calling CachedDomainDataAccess.evict(Object). This method is used by "synchronous" concurrency strategies.
      Parameters:
      session - Current session
      key - The item key
      value - The item
      currentVersion - The item's current version value
      previousVersion - The item's previous version value
      Returns:
      Were the contents of the cache actually changed by this operation?
      Throws:
      CacheException - Propagated from underlying cache provider
    • afterUpdate

      boolean afterUpdate(SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
      Called after an item has been updated (after the transaction completes), instead of calling
      invalid reference
      #release
      . This method is used by "asynchronous" concurrency strategies.
      Parameters:
      session - Current session
      key - The item key
      value - The item
      currentVersion - The item's current version value
      previousVersion - The item's previous version value
      lock - The lock previously obtained from CachedDomainDataAccess.lockItem(SharedSessionContractImplementor, Object, Object)
      Returns:
      Were the contents of the cache actually changed by this operation?
      Throws:
      CacheException - Propagated from underlying cache provider