org.datanucleus.store.query
Class AbstractJDOQLQuery

java.lang.Object
  extended by org.datanucleus.store.query.Query
      extended by org.datanucleus.store.query.AbstractJavaQuery
          extended by org.datanucleus.store.query.AbstractJDOQLQuery
All Implemented Interfaces:
java.io.Serializable

public abstract class AbstractJDOQLQuery
extends AbstractJavaQuery

Abstract representation of a JDOQL query. The query can be specified via method calls, or via a single-string form.

See Also:
Query, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.query.Query
Query.SubqueryDefinition
 
Field Summary
 
Fields inherited from class org.datanucleus.store.query.AbstractJavaQuery
candidateCollection, candidateExtent, resultMetaData, singleString, userDefinedScalarExpressions
 
Fields inherited from class org.datanucleus.store.query.Query
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, compilation, explicitParameters, explicitVariables, extensions, filter, from, fromInclNo, grouping, having, ignoreCache, IMPLICIT_POSITIONAL_PARAM_PREFIX, implicitParameters, imports, LOCALISER, om, ordering, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, subclasses, subqueries, toExclNo, type, unique, unmodifiable, update
 
Constructor Summary
AbstractJDOQLQuery(ObjectManager om)
          Constructor.
AbstractJDOQLQuery(ObjectManager om, AbstractJDOQLQuery q)
          Constructs a new query instance having the same criteria as the given query.
AbstractJDOQLQuery(ObjectManager om, java.lang.String query)
          Constructor for a JDOQL query where the query is specified using the "Single-String" format.
 
Method Summary
protected  void compileInternal(boolean forExecute, java.util.Map parameterValues)
          Method to compile the JDOQL query.
 java.lang.String getSingleStringQuery()
          Method to take the defined parameters for the query and form a single string.
 void setGrouping(java.lang.String grouping)
          Set the grouping specification for the result Collection.
 void setResult(java.lang.String result)
          Set the result for the results.
 
Methods inherited from class org.datanucleus.store.query.AbstractJavaQuery
discardCompiled, evaluateInMemory, getCandidateCollection, getCandidateExtent, getParsedImports, getResultSetMetaData, getUserDefinedScalarExpressions, performDeletePersistentAll, registerScalarExpression, registerScalarExpressions, setCandidates, setCandidates, toString
 
Methods inherited from class org.datanucleus.store.query.Query
addExtension, addSubquery, applyRangeChecks, assertIsModifiable, close, closeAll, compile, declareExplicitParameters, declareExplicitVariables, declareImports, deletePersistentAll, deletePersistentAll, deletePersistentAll, equals, execute, execute, execute, execute, executeQuery, executeWithArray, executeWithMap, getCandidateClass, getCandidateClassName, getExplicitParameters, getExplicitVariables, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImports, getInputParameters, getObjectManager, getOrdering, getParameterMapForValues, getRange, getRangeFromIncl, getRangeToExcl, getResult, getResultClass, getResultClassName, getResultDistinct, getStoreManager, getSubqueryForVariable, getType, getUpdate, hashCode, hasSubqueryForVariable, isCompiled, isSubclasses, isUnique, isUnmodifiable, performExecute, prepareDatastore, resolveClassDeclaration, resultHasOnlyAggregates, setCandidateClassName, setClass, setExtensions, setFetchPlan, setFilter, setFrom, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setOrdering, setRange, setRange, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSubclasses, setType, setUnique, setUnmodifiable, setUpdate, shouldReturnSingleRow
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractJDOQLQuery

public AbstractJDOQLQuery(ObjectManager om)
Constructor.

Parameters:
om - ObjectManager

AbstractJDOQLQuery

public AbstractJDOQLQuery(ObjectManager om,
                          AbstractJDOQLQuery q)
Constructs a new query instance having the same criteria as the given query.

Parameters:
om - The ObjectManager
q - The query from which to copy criteria.

AbstractJDOQLQuery

public AbstractJDOQLQuery(ObjectManager om,
                          java.lang.String query)
Constructor for a JDOQL query where the query is specified using the "Single-String" format.

Parameters:
om - The persistence manager
query - The query string
Method Detail

setGrouping

public void setGrouping(java.lang.String grouping)
Set the grouping specification for the result Collection.

Overrides:
setGrouping in class Query
Parameters:
grouping - the grouping specification.

setResult

public void setResult(java.lang.String result)
Set the result for the results.

Overrides:
setResult in class Query
Parameters:
result - Optional keyword "distinct" followed by comma-separated list of result expressions or a result class

getSingleStringQuery

public java.lang.String getSingleStringQuery()
Method to take the defined parameters for the query and form a single string. This is used to print out the query for logging.

Specified by:
getSingleStringQuery in class AbstractJavaQuery
Returns:
The single string

compileInternal

protected void compileInternal(boolean forExecute,
                               java.util.Map parameterValues)
Method to compile the JDOQL query. This implementation assumes that we are using the "generic" JDOQL compiler in org.datanucleus.query.compiler. If not then override this method. Will populate the "compilation" class variable.

Specified by:
compileInternal in class Query
Parameters:
forExecute - Whether compiling for execution NOT USED HERE. TODO Remove this when possible
parameterValues - Map of param values keyed by param name. TODO Remove this when possible


Copyright © 2009. All Rights Reserved.