Class QueryDescriptor
java.lang.Object
org.apache.cayenne.map.QueryDescriptor
- All Implemented Interfaces:
ProjectNode, XMLSerializable
- Direct Known Subclasses:
ProcedureQueryDescriptor, SelectQueryDescriptor, SQLTemplateDescriptor
Generic descriptor of a Cayenne query.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TacceptVisitor(ProjectNodeVisitor<T> visitor) abstract QueryAssembles Cayenne query instance of appropriate type from this descriptor.abstract QuerybuildQuery(Map<String, ?> parameters) Assembles Cayenne query instance of appropriate type from this descriptor, applying a map of named parameters to it.Returns the cache group of the query, or null if none is set.Returns the cache strategy of the query, that is never null.getName()Returns name of the query.intReturns the page size of the query.getRoot()Returns the root of this query.intReturns the JDBC statement fetch size of the query.booleanReturns whether the query fetches DataRows instead of Persistent objects.voidsetCacheGroup(String cacheGroup) voidsetCacheStrategy(QueryCacheStrategy cacheStrategy) Sets the cache strategy of the query.voidsetDataMap(DataMap dataMap) voidsetFetchingDataRows(boolean fetchingDataRows) voidSets name of the query.voidsetPageSize(int pageSize) voidSets the root of this query.voidsetStatementFetchSize(int statementFetchSize) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface XMLSerializable
encodeAsXML
-
Field Details
-
OBJ_ENTITY_ROOT
- Since:
- 4.1
- See Also:
-
DB_ENTITY_ROOT
- Since:
- 4.1
- See Also:
-
PROCEDURE_ROOT
- Since:
- 4.1
- See Also:
-
DATA_MAP_ROOT
- Since:
- 4.1
- See Also:
-
JAVA_CLASS_ROOT
- Since:
- 4.1
- See Also:
-
name
-
dataMap
-
root
-
cacheStrategy
-
cacheGroup
-
fetchingDataRows
protected boolean fetchingDataRows -
pageSize
protected int pageSize -
statementFetchSize
protected int statementFetchSize
-
-
Constructor Details
-
QueryDescriptor
public QueryDescriptor()
-
-
Method Details
-
getName
Returns name of the query. -
setName
Sets name of the query. -
getDataMap
-
setDataMap
-
getRoot
Returns the root of this query. -
setRoot
Sets the root of this query. -
getPageSize
public int getPageSize()Returns the page size of the query. Zero means no pagination.- Since:
- 5.0
-
setPageSize
public void setPageSize(int pageSize) - Since:
- 5.0
-
getStatementFetchSize
public int getStatementFetchSize()Returns the JDBC statement fetch size of the query. Zero means the driver default.- Since:
- 5.0
-
setStatementFetchSize
public void setStatementFetchSize(int statementFetchSize) - Since:
- 5.0
-
isFetchingDataRows
public boolean isFetchingDataRows()Returns whether the query fetches DataRows instead of Persistent objects.- Since:
- 5.0
-
setFetchingDataRows
public void setFetchingDataRows(boolean fetchingDataRows) - Since:
- 5.0
-
getCacheStrategy
Returns the cache strategy of the query, that is never null.- Since:
- 5.0
-
setCacheStrategy
Sets the cache strategy of the query. A null value resets it to the default strategy.- Since:
- 5.0
-
getCacheGroup
Returns the cache group of the query, or null if none is set.- Since:
- 5.0
-
setCacheGroup
- Since:
- 5.0
-
buildQuery
Assembles Cayenne query instance of appropriate type from this descriptor. -
buildQuery
-
acceptVisitor
- Specified by:
acceptVisitorin interfaceProjectNode
-