Interface QueryResultsCache


public interface QueryResultsCache
Responsible for managing query result list caching in a specific query cache region. There may be multiple instances of QueryResultsCache, corresponding to second-level cache regions with distinct policies.

A QueryResultsCache depends on the TimestampsCache to track invalidation of the query spaces (tables) which affect the cached queries. A cached query result list is considered stale if any one of the query spaces which affect the query results was invalidated since the result list was read from the database and stored in the query result cache.

  • Method Details

    • getRegion

      The underlying cache region being used.
    • put

      Store a result list of a query with the given QueryKey in the query result cache.
      Parameters:
      key - The cache key uniquely identifying the query and its bound parameter arguments
      result - The result list to cache
      session - The originating session
      Returns:
      Whether the put actually happened.
      Throws:
      HibernateException - Indicates a problem delegating to the underlying cache.
    • get

      Attempt to retrieve a cached query result list for the given QueryKey from the cache region, and then check if the cached results, if any, are stale. If there is no cached result list for the given key, or if the cached results are stale, return null.
      Parameters:
      key - The cache key uniquely identifying the query and its bound parameter arguments
      spaces - The query spaces which affect the results of the query (used to check if cached results are stale)
      session - The originating session
      Returns:
      The cached results; may be null if there are no cached results for the given key, or if the results are stale.
      Throws:
      HibernateException - Indicates a problem delegating to the underlying cache.
    • get

      Attempt to retrieve a cached query result list for the given QueryKey from the cache region, and then check if the cached results, if any, are stale. If there is no cached result list for the given key, or if the cached results are stale, return null.
      Parameters:
      key - The cache key uniquely identifying the query and its bound parameter arguments
      spaces - The query spaces which affect the results of the query (used to check if cached results are stale)
      session - The originating session
      Returns:
      The cached results; may be null.
      Throws:
      HibernateException - Indicates a problem delegating to the underlying cache.
    • clear

      void clear() throws CacheException
      Throws:
      CacheException
    • destroy

      @Deprecated(since="8.0", forRemoval=true) default void destroy()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This noop method is never called