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, singleString
 
Fields inherited from class org.datanucleus.store.query.Query
BULK_DELETE, BULK_UPDATE, candidateClass, candidateClassName, clr, compilation, ec, explicitParameters, explicitVariables, extensions, filter, from, fromInclNo, fromInclParam, grouping, having, ignoreCache, implicitParameters, imports, LOCALISER, ordering, OTHER, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, subclasses, subqueries, tasks, toExclNo, toExclParam, type, unique, unmodifiable, update
 
Constructor Summary
AbstractJDOQLQuery(ExecutionContext ec)
          Constructor.
AbstractJDOQLQuery(ExecutionContext ec, AbstractJDOQLQuery q)
          Constructs a new query instance having the same criteria as the given query.
AbstractJDOQLQuery(ExecutionContext ec, java.lang.String query)
          Constructor for a JDOQL query where the query is specified using the "Single-String" format.
 
Method Summary
protected  void compileInternal(java.util.Map parameterValues)
          Method to compile the JDOQL query.
 java.lang.String getLanguage()
          Accessor for the query language.
 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, getSupportedExtensions, performDeletePersistentAll, setCandidates, setCandidates, toString
 
Methods inherited from class org.datanucleus.store.query.Query
addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyRangeChecks, assertIsModifiable, assertSupportsCancel, cancel, cancel, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, declareExplicitParameters, declareExplicitVariables, declareImports, deletePersistentAll, deletePersistentAll, deletePersistentAll, equals, execute, executeInSeparateThread, executeQuery, executeWithArray, executeWithMap, getBooleanExtensionProperty, getCandidateClass, getCandidateClassName, getCompilation, getDatastoreReadTimeoutMillis, getDatastoreWriteTimeoutMillis, getExplicitParameters, getExplicitVariables, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImports, getInputParameters, getObjectManager, getOrdering, getParameterMapForValues, getParsedImports, getQueryManager, getRange, getRangeFromIncl, getRangeFromInclParam, getRangeToExcl, getRangeToExclParam, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getSubqueryForVariable, getType, getUpdate, hashCode, hasSubqueryForVariable, isCompiled, isSubclasses, isUnique, isUnmodifiable, performExecute, performExecuteInternal, performExecuteTask, prepareDatastore, resolveClassDeclaration, setCandidateClassName, setClass, setCompilation, setDatastoreReadTimeoutMillis, setDatastoreWriteTimeoutMillis, setExtensions, setFetchPlan, setFilter, setFrom, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setOrdering, setRange, setRange, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSerializeRead, setSubclasses, setType, setUnique, setUnmodifiable, setUpdate, shouldReturnSingleRow, supportsTimeout, useCaching, useFetchPlan, useResultsCaching
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractJDOQLQuery

public AbstractJDOQLQuery(ExecutionContext ec)
Constructor.

Parameters:
ec - execution context

AbstractJDOQLQuery

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

Parameters:
ec - execution context
q - The query from which to copy criteria.

AbstractJDOQLQuery

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

Parameters:
ec - execution context
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(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:
parameterValues - Map of parameter values keyed by parameter name.

getLanguage

public java.lang.String getLanguage()
Accessor for the query language.

Overrides:
getLanguage in class Query
Returns:
Query language


Copyright © 2011. All Rights Reserved.