Package org.apache.cayenne.query
Class CacheableQuery
java.lang.Object
org.apache.cayenne.query.CacheableQuery
- All Implemented Interfaces:
Serializable
,Query
- Direct Known Subclasses:
AbstractQuery
,EJBQLQuery
Shared functionality for cacheable queries.
- Since:
- 4.0
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.apache.cayenne.query.BaseQueryMetadata
void
setCacheGroup
(String cacheGroup) void
setCacheStrategy
(QueryCacheStrategy strategy) void
Instructs Cayenne to look for query results in the "local" cache when running the query.void
useLocalCache
(String cacheGroup) Instructs Cayenne to look for query results in the "local" cache when running the query.void
Instructs Cayenne to look for query results in the "shared" cache when running the query.void
useSharedCache
(String cacheGroup) Instructs Cayenne to look for query results in the "shared" cache when running the query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cayenne.query.Query
createSQLAction, getMetaData, route
-
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
- Since:
- 3.0
-
setCacheStrategy
- Since:
- 3.0
-
getCacheGroup
- Since:
- 4.0
-
setCacheGroup
- 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
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
-