Interface EntityDataAccess

    • Method Detail

      • generateCacheKey

        java.lang.Object generateCacheKey​(java.lang.Object id,
                                          EntityPersister rootEntityDescriptor,
                                          SessionFactoryImplementor factory,
                                          java.lang.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?
      • insert

        boolean insert​(SharedSessionContractImplementor session,
                       java.lang.Object key,
                       java.lang.Object value,
                       java.lang.Object version)
        Called afterQuery an item has been inserted (beforeQuery the transaction completes), instead of calling evict(). 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 actual changed by this operation?
        Throws:
        CacheException - Propagated from underlying cache provider
      • afterInsert

        boolean afterInsert​(SharedSessionContractImplementor session,
                            java.lang.Object key,
                            java.lang.Object value,
                            java.lang.Object version)
        Called afterQuery an item has been inserted (afterQuery the transaction completes), instead of calling 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,
                       java.lang.Object key,
                       java.lang.Object value,
                       java.lang.Object currentVersion,
                       java.lang.Object previousVersion)
        Called afterQuery an item has been updated (beforeQuery the transaction completes), instead of calling evict(). 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 actual changed by this operation?
        Throws:
        CacheException - Propagated from underlying cache provider