org.datanucleus.store.query
Class AbstractJavaQuery

java.lang.Object
  extended by org.datanucleus.store.query.Query
      extended by org.datanucleus.store.query.AbstractJavaQuery
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbstractJDOQLQuery, AbstractJPQLQuery

public abstract class AbstractJavaQuery
extends Query

Abstract representation of a Java-based query. To be extended by Java-based query languages.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.query.Query
Query.SubqueryDefinition
 
Field Summary
protected  java.util.Collection candidateCollection
          Collection of candidates for this query.
protected  Extent candidateExtent
          Extent of candidates for this query.
protected  java.lang.String singleString
          Cached form of the single string form of the query.
 
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
AbstractJavaQuery(ExecutionContext ec)
          Constructor for a Java-based query.
 
Method Summary
protected  void discardCompiled()
          Method to discard our current compiled query due to changes.
protected  boolean evaluateInMemory()
          Convenience method to return whether the query should be evaluated in-memory.
 java.util.Collection getCandidateCollection()
          Accessor for the candidate collection (if specified using a collection).
 Extent getCandidateExtent()
          Accessor for the candidate Extent (if specified using an Extent).
abstract  java.lang.String getSingleStringQuery()
          Accessor for a single string form of the query.
 java.util.Set<java.lang.String> getSupportedExtensions()
          Method to return the names of the extensions supported by this query.
protected  long performDeletePersistentAll(java.util.Map parameters)
          Execute the query to delete persistent objects.
 void setCandidates(java.util.Collection pcs)
          Set the candidate collection to query.
 void setCandidates(Extent pcs)
          Set the candidate Extent to query.
 java.lang.String toString()
          Stringifier method
 
Methods inherited from class org.datanucleus.store.query.Query
addExtension, addSubquery, applyImplicitParameterValueToCompilation, applyRangeChecks, assertIsModifiable, assertSupportsCancel, cancel, cancel, checkParameterTypesAgainstCompilation, checkUnusedParameters, close, closeAll, compile, compileInternal, 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, getLanguage, 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, setGrouping, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setOrdering, setRange, setRange, setResult, 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
 

Field Detail

candidateExtent

protected transient Extent candidateExtent
Extent of candidates for this query.


candidateCollection

protected transient java.util.Collection candidateCollection
Collection of candidates for this query.


singleString

protected java.lang.String singleString
Cached form of the single string form of the query.

Constructor Detail

AbstractJavaQuery

public AbstractJavaQuery(ExecutionContext ec)
Constructor for a Java-based query.

Parameters:
ec - ExecutionContext
Method Detail

setCandidates

public void setCandidates(Extent pcs)
Set the candidate Extent to query. Passing in null clears off the current candidate Extent.

Specified by:
setCandidates in class Query
Parameters:
pcs - the Candidate Extent.
See Also:
Query.setCandidates(javax.jdo.Extent)

setCandidates

public void setCandidates(java.util.Collection pcs)
Set the candidate collection to query. Passing in null clears off the current candidate collection.

Specified by:
setCandidates in class Query
Parameters:
pcs - the Candidate collection.
See Also:
Query.setCandidates(java.util.Collection)

getCandidateExtent

public Extent getCandidateExtent()
Accessor for the candidate Extent (if specified using an Extent).

Returns:
Candidate Extent

getCandidateCollection

public java.util.Collection getCandidateCollection()
Accessor for the candidate collection (if specified using a collection).

Returns:
Candidate collection

discardCompiled

protected void discardCompiled()
Method to discard our current compiled query due to changes.

Overrides:
discardCompiled in class Query
See Also:
Query.discardCompiled()

performDeletePersistentAll

protected long performDeletePersistentAll(java.util.Map parameters)
Execute the query to delete persistent objects.

Overrides:
performDeletePersistentAll in class Query
Parameters:
parameters - the Map containing all of the parameters.
Returns:
the number of deleted objects.

getSingleStringQuery

public abstract java.lang.String getSingleStringQuery()
Accessor for a single string form of the query.

Returns:
Single string form of the query.

toString

public java.lang.String toString()
Stringifier method

Overrides:
toString in class java.lang.Object
Returns:
Single-string form of this query.

evaluateInMemory

protected boolean evaluateInMemory()
Convenience method to return whether the query should be evaluated in-memory.

Returns:
Use in-memory evaluation?

getSupportedExtensions

public java.util.Set<java.lang.String> getSupportedExtensions()
Method to return the names of the extensions supported by this query. To be overridden by subclasses where they support additional extensions.

Overrides:
getSupportedExtensions in class Query
Returns:
The supported extension names


Copyright © 2011. All Rights Reserved.