Package org.apache.cayenne.query
Class EJBQLQuery
java.lang.Object
org.apache.cayenne.query.CacheableQuery
org.apache.cayenne.query.EJBQLQuery
- All Implemented Interfaces:
- Serializable,- Query
public class EJBQLQuery extends CacheableQuery
An EJBQL query representation in Cayenne.
- Since:
- 3.0
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected StringejbqlStatementprotected EJBQLCompiledExpressionexpressionprotected Map<String,Object>namedParametersprotected Map<Integer,Object>positionalParametersFields inherited from class org.apache.cayenne.query.CacheableQuerylogger
- 
Constructor SummaryConstructors Constructor Description EJBQLQuery()EJBQLQuery(String ejbqlStatement)
- 
Method SummaryModifier and Type Method Description SQLActioncreateSQLAction(SQLActionVisitor visitor)A callback method invoked by Cayenne during the final execution phase of the query run.protected org.apache.cayenne.query.BaseQueryMetadatagetBaseMetaData()StringgetEjbqlStatement()Returns an unparsed EJB QL statement used to initialize this query.EJBQLCompiledExpressiongetExpression(EntityResolver resolver)Returns lazily initialized EJBQLCompiledExpression for this query EJBQL.intgetFetchLimit()Returns the fetchLimit property indicating the maximum number of rows this query would return.intgetFetchOffset()QueryMetadatagetMetaData(EntityResolver resolver)Returns query runtime parameters.Map<String,Object>getNamedParameters()Returns unmodifiable map of combined named and positional parameters.intgetPageSize()Map<Integer,Object>getPositionalParameters()intgetStatementFetchSize()voidinitWithProperties(Map<String,?> properties)booleanisFetchingDataRows()voidroute(QueryRouter router, EntityResolver resolver, Query substitutedQuery)A callback method invoked by Cayenne during the routing phase of the query execution.voidsetEjbqlStatement(String text)voidsetFetchingDataRows(boolean flag)voidsetFetchLimit(int fetchLimit)Sets the fetchLimit property indicating the maximum number of rows this query would return.voidsetFetchOffset(int fetchOffset)voidsetPageSize(int pageSize)voidsetParameter(int position, Object object)Sets a positional query parameter value.voidsetParameter(String name, Object object)Sets a named query parameter value.voidsetStatementFetchSize(int size)Sets statement's fetch size (0 for no default size)Methods inherited from class org.apache.cayenne.query.CacheableQuerygetCacheGroup, getCacheStrategy, setCacheGroup, setCacheStrategy, useLocalCache, useLocalCache, useSharedCache, useSharedCache
- 
Field Details- 
ejbqlStatement
- 
namedParameters
- 
positionalParameters
- 
expression
 
- 
- 
Constructor Details- 
EJBQLQuery
- 
EJBQLQuerypublic EJBQLQuery()
 
- 
- 
Method Details- 
initWithProperties
- 
getMetaDataDescription copied from interface:QueryReturns query runtime parameters. The method is called at various stages of the execution by Cayenne access stack to retrieve query parameters. EntityResolver instance is passed to this method, meaning that the query doesn't need to store direct references to Cayenne mapping objects and can resolve them at runtime.
- 
isFetchingDataRowspublic boolean isFetchingDataRows()
- 
setFetchingDataRowspublic void setFetchingDataRows(boolean flag)
- 
getBaseMetaDataprotected org.apache.cayenne.query.BaseQueryMetadata getBaseMetaData()- Specified by:
- getBaseMetaDatain class- CacheableQuery
 
- 
routeDescription copied from interface:QueryA callback method invoked by Cayenne during the routing phase of the query execution. Mapping of DataNodes is provided by QueryRouter. Query should use aQueryRouter.route(QueryEngine, Query, Query)callback method to route itself. Query can create one or more substitute queries or even provide its own QueryEngine to execute itself.
- 
createSQLActionDescription copied from interface:QueryA callback method invoked by Cayenne during the final execution phase of the query run. A concrete query implementation is given a chance to decide how it should be handled. Implementors can pick an appropriate method of the SQLActionVisitor to handle itself, create a custom SQLAction of its own, or substitute itself with another query that should be used for SQLAction construction.
- 
getEjbqlStatementReturns an unparsed EJB QL statement used to initialize this query.
- 
getExpressionReturns lazily initialized EJBQLCompiledExpression for this query EJBQL.- Throws:
- EJBQLException
 
- 
getNamedParametersReturns unmodifiable map of combined named and positional parameters. Positional parameter keys are Integers, while named parameter keys are strings.
- 
getPositionalParameters
- 
setParameterSets a named query parameter value.
- 
setParameterSets a positional query parameter value. Note that parameter indexes are starting from 1.
- 
getFetchLimitpublic int getFetchLimit()Returns the fetchLimit property indicating the maximum number of rows this query would return.
- 
setFetchLimitpublic void setFetchLimit(int fetchLimit)Sets the fetchLimit property indicating the maximum number of rows this query would return.
- 
getFetchOffsetpublic int getFetchOffset()
- 
setFetchOffsetpublic void setFetchOffset(int fetchOffset)
- 
setEjbqlStatement
- 
getPageSizepublic int getPageSize()
- 
setPageSizepublic void setPageSize(int pageSize)
- 
setStatementFetchSizepublic void setStatementFetchSize(int size)Sets statement's fetch size (0 for no default size)- Since:
- 3.0
 
- 
getStatementFetchSizepublic int getStatementFetchSize()- Returns:
- statement's fetch size
- Since:
- 3.0
 
 
-