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
public abstract class CacheableQuery extends Object implements Query
Shared functionality for cacheable queries.
- Since:
- 4.0
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected static org.slf4j.Loggerlogger
- 
Constructor SummaryConstructors Constructor Description CacheableQuery()
- 
Method SummaryModifier and Type Method Description protected abstract org.apache.cayenne.query.BaseQueryMetadatagetBaseMetaData()StringgetCacheGroup()QueryCacheStrategygetCacheStrategy()voidsetCacheGroup(String cacheGroup)voidsetCacheStrategy(QueryCacheStrategy strategy)voiduseLocalCache()Instructs Cayenne to look for query results in the "local" cache when running the query.voiduseLocalCache(String cacheGroup)Instructs Cayenne to look for query results in the "local" cache when running the query.voiduseSharedCache()Instructs Cayenne to look for query results in the "shared" cache when running the query.voiduseSharedCache(String cacheGroup)Instructs Cayenne to look for query results in the "shared" cache when running the query.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cayenne.query.QuerycreateSQLAction, getMetaData, route
- 
Field Details- 
loggerprotected static final org.slf4j.Logger logger
 
- 
- 
Constructor Details- 
CacheableQuerypublic CacheableQuery()
 
- 
- 
Method Details- 
getBaseMetaDataprotected abstract org.apache.cayenne.query.BaseQueryMetadata getBaseMetaData()
- 
getCacheStrategy- Since:
- 3.0
 
- 
setCacheStrategy- Since:
- 3.0
 
- 
getCacheGroup- Since:
- 4.0
 
- 
setCacheGroup- Since:
- 4.0
 
- 
useLocalCachepublic 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
 
- 
useLocalCacheInstructs 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
 
 
-