public class EJBQLQuery extends Object implements Query, XMLSerializable
Modifier and Type | Field and Description |
---|---|
protected DataMap |
dataMap |
protected String |
ejbqlStatement |
protected EJBQLCompiledExpression |
expression |
protected String |
name |
protected Map<String,Object> |
namedParameters |
protected Map<Integer,Object> |
positionalParameters |
Constructor and Description |
---|
EJBQLQuery() |
EJBQLQuery(String ejbqlStatement) |
Modifier and Type | Method and Description |
---|---|
<T> T |
acceptVisitor(ConfigurationNodeVisitor<T> visitor) |
SQLAction |
createSQLAction(SQLActionVisitor visitor)
A callback method invoked by Cayenne during the final execution phase of the query
run.
|
void |
encodeAsXML(XMLEncoder encoder)
Prints itself as XML to the provided XMLEncoder.
|
String[] |
getCacheGroups() |
QueryCacheStrategy |
getCacheStrategy() |
DataMap |
getDataMap() |
String |
getEjbqlStatement()
Returns an unparsed EJB QL statement used to initialize this query.
|
EJBQLCompiledExpression |
getExpression(EntityResolver resolver)
Returns lazily initialized EJBQLCompiledExpression for this query EJBQL.
|
int |
getFetchLimit()
Returns the fetchLimit property indicating the maximum number of rows this query
would return.
|
int |
getFetchOffset() |
QueryMetadata |
getMetaData(EntityResolver resolver)
Returns query runtime parameters.
|
String |
getName()
Returns a symbolic name of the query.
|
Map<String,Object> |
getNamedParameters()
Returns unmodifiable map of combined named and positional parameters.
|
int |
getPageSize() |
Map<Integer,Object> |
getPositionalParameters() |
int |
getStatementFetchSize() |
void |
initWithProperties(Map<String,?> properties) |
boolean |
isFetchingDataRows() |
void |
route(QueryRouter router,
EntityResolver resolver,
Query substitutedQuery)
A callback method invoked by Cayenne during the routing phase of the query
execution.
|
void |
setCacheGroups(String... cacheGroups) |
void |
setCacheStrategy(QueryCacheStrategy strategy) |
void |
setDataMap(DataMap dataMap) |
void |
setEjbqlStatement(String text) |
void |
setFetchingDataRows(boolean flag) |
void |
setFetchLimit(int fetchLimit)
Sets the fetchLimit property indicating the maximum number of rows this query would
return.
|
void |
setFetchOffset(int fetchOffset) |
void |
setName(String name) |
void |
setPageSize(int pageSize) |
void |
setParameter(int position,
Object object)
Sets a positional query parameter value.
|
void |
setParameter(String name,
Object object)
Sets a named query parameter value.
|
void |
setStatementFetchSize(int size)
Sets statement's fetch size (0 for no default size)
|
void |
useLocalCache(String... cacheGroups)
Instructs Cayenne to look for query results in the "local" cache when
running the query.
|
void |
useSharedCache(String... cacheGroups)
Instructs Cayenne to look for query results in the "shared" cache when
running the query.
|
protected String name
protected DataMap dataMap
protected String ejbqlStatement
protected transient EJBQLCompiledExpression expression
public EJBQLQuery(String ejbqlStatement)
public EJBQLQuery()
public DataMap getDataMap()
getDataMap
in interface Query
public void setDataMap(DataMap dataMap)
public <T> T acceptVisitor(ConfigurationNodeVisitor<T> visitor)
acceptVisitor
in interface ConfigurationNode
public QueryMetadata getMetaData(EntityResolver resolver)
Query
getMetaData
in interface Query
public boolean isFetchingDataRows()
public void setFetchingDataRows(boolean flag)
public String[] getCacheGroups()
public QueryCacheStrategy getCacheStrategy()
public void setCacheGroups(String... cacheGroups)
public void setCacheStrategy(QueryCacheStrategy strategy)
public void useLocalCache(String... cacheGroups)
query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE); query.setCacheGroups("group1", "group2");
public void useSharedCache(String... cacheGroups)
query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE); query.setCacheGroups("group1", "group2");
public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
Query
QueryRouter.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.public SQLAction createSQLAction(SQLActionVisitor visitor)
Query
createSQLAction
in interface Query
public String getEjbqlStatement()
public EJBQLCompiledExpression getExpression(EntityResolver resolver) throws EJBQLException
EJBQLException
public String getName()
Query
public void setName(String name)
public Map<String,Object> getNamedParameters()
public void setParameter(String name, Object object)
public void setParameter(int position, Object object)
public int getFetchLimit()
public void setFetchLimit(int fetchLimit)
public int getFetchOffset()
public void setFetchOffset(int fetchOffset)
public void encodeAsXML(XMLEncoder encoder)
XMLSerializable
encodeAsXML
in interface XMLSerializable
public void setEjbqlStatement(String text)
public int getPageSize()
public void setPageSize(int pageSize)
public void setStatementFetchSize(int size)
public int getStatementFetchSize()
Copyright © 2001–2015 Apache Cayenne. All rights reserved.