Class CacheableQuery

java.lang.Object
org.apache.cayenne.query.CacheableQuery
All Implemented Interfaces:
Serializable, Query
Direct Known Subclasses:
AbstractQuery, EJBQLQuery

public abstract class CacheableQuery
extends Object
implements Query
Shared functionality for cacheable queries.
Since:
4.0
See Also:
Serialized Form
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
  • Constructor Details

    • CacheableQuery

      public CacheableQuery()
  • Method Details

    • getBaseMetaData

      protected abstract org.apache.cayenne.query.BaseQueryMetadata getBaseMetaData()
    • getCacheStrategy

      public QueryCacheStrategy getCacheStrategy()
      Since:
      3.0
    • setCacheStrategy

      public void setCacheStrategy​(QueryCacheStrategy strategy)
      Since:
      3.0
    • getCacheGroup

      public String getCacheGroup()
      Since:
      4.0
    • setCacheGroup

      public void setCacheGroup​(String cacheGroup)
      Since:
      4.0
    • useLocalCache

      public void useLocalCache()
      Instructs Cayenne to look for query results in the "local" cache when running the query. This is a short-hand notation for:
       query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
       
      Since:
      4.0
    • useLocalCache

      public void useLocalCache​(String cacheGroup)
      Instructs Cayenne to look for query results in the "local" cache when running the query. This is a short-hand notation for:
       query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
       query.setCacheGroups("group1", "group2");
       
      Since:
      4.0
    • useSharedCache

      public void useSharedCache()
      Instructs Cayenne to look for query results in the "shared" cache when running the query. This is a short-hand notation for:
       query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
       
      Since:
      4.0
    • useSharedCache

      public void useSharedCache​(String cacheGroup)
      Instructs Cayenne to look for query results in the "shared" cache when running the query. This is a short-hand notation for:
       query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
       query.setCacheGroups("group1", "group2");
       
      Since:
      4.0