Class QueryResultsCacheImpl

  • All Implemented Interfaces:
    QueryResultsCache

    public class QueryResultsCacheImpl
    extends Object
    implements QueryResultsCache
    The standard implementation of the Hibernate QueryCache interface. Works hind-in-hand with TimestampsCache to help in recognizing stale query results.
    • Method Detail

      • get

        public List<?> get​(QueryKey key,
                           Set<String> spaces,
                           SharedSessionContractImplementor session)
                    throws HibernateException
        Description copied from interface: QueryResultsCache
        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.
        Specified by:
        get in interface QueryResultsCache
        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

        public List<?> get​(QueryKey key,
                           String[] spaces,
                           SharedSessionContractImplementor session)
                    throws HibernateException
        Description copied from interface: QueryResultsCache
        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.
        Specified by:
        get in interface QueryResultsCache
        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.