Interface NaturalIdDataAccess

    • Method Detail

      • generateCacheKey

        java.lang.Object generateCacheKey​(java.lang.Object[] naturalIdValues,
                                          EntityPersister rootEntityDescriptor,
                                          SharedSessionContractImplementor session)
        To create instances of NaturalIdCacheKey for this region, Hibernate will invoke this method exclusively so that generated implementations can generate optimised keys.
        Parameters:
        naturalIdValues - the sequence of values which unequivocally identifies a cached element on this region
        rootEntityDescriptor - the persister of the element being cached
        Returns:
        a key which can be used to identify an element unequivocally on this same region
      • insert

        boolean insert​(SharedSessionContractImplementor session,
                       java.lang.Object key,
                       java.lang.Object value)
        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
        Returns:
        Were the contents of the cache actually changed by this operation?
        Throws:
        CacheException - Propagated from underlying cache provider
      • afterInsert

        boolean afterInsert​(SharedSessionContractImplementor session,
                            java.lang.Object key,
                            java.lang.Object value)
        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
        Returns:
        Were the contents of the cache actually changed by this operation?
        Throws:
        CacheException - Propagated from underlying cache provider
      • update

        boolean update​(SharedSessionContractImplementor session,
                       java.lang.Object key,
                       java.lang.Object value)
        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
        Returns:
        Were the contents of the cache actually changed by this operation?
        Throws:
        CacheException - Propagated from underlying cache provider