org.datanucleus.store.neodatis.query
Class CriteriaQuery

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

public class CriteriaQuery
extends org.datanucleus.store.query.AbstractJavaQuery

Representation of a NeoDatis "Criteria" query for use in DataNucleus. Created by passing in the CriteriaQuery object.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.query.Query
org.datanucleus.store.query.Query.SubqueryDefinition
 
Field Summary
protected static org.datanucleus.util.Localiser LOCALISER_NEODATIS
          Localiser for messages.
 
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, compilation, explicitParameters, explicitVariables, extensions, filter, from, fromInclNo, grouping, having, ignoreCache, implicitParameters, imports, LOCALISER, om, ordering, parameterNames, parsedImports, queryResults, range, result, resultClass, resultClassName, resultDistinct, SELECT, subclasses, subqueries, tasks, toExclNo, type, unique, unmodifiable, update
 
Constructor Summary
CriteriaQuery(org.datanucleus.ObjectManager om)
          Constructs a new query instance that uses the given persistence manager.
CriteriaQuery(org.datanucleus.ObjectManager om, java.lang.Object criteriaQuery)
          Constructor for a query using NeoDatis "native" query language.
 
Method Summary
protected  void compileInternal(boolean forExecute, java.util.Map parameterValues)
          Method to compile the query.
 java.lang.String getSingleStringQuery()
          Method to return the query as a single string.
protected  boolean isCompiled()
          Method to return if the query is compiled.
protected  java.lang.Object performExecute(java.util.Map parameters)
          Method to execute the query.
protected  boolean shouldReturnSingleRow()
          Convenience method to return whether the query should return a single row.
 
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, close, closeAll, compile, declareExplicitParameters, declareExplicitVariables, declareImports, deletePersistentAll, deletePersistentAll, deletePersistentAll, equals, execute, executeQuery, executeWithArray, executeWithMap, getBooleanExtensionProperty, getCandidateClass, getCandidateClassName, getCompilation, getExplicitParameters, getExplicitVariables, getExtension, getExtensions, getFetchPlan, getFilter, getFrom, getGrouping, getHaving, getIgnoreCache, getImplicitParameters, getImports, getInputParameters, getObjectManager, getOrdering, getParameterMapForValues, getParsedImports, getPerformExecuteTask, getRange, getRangeFromIncl, getRangeToExcl, getResult, getResultClass, getResultClassName, getResultDistinct, getSerializeRead, getStoreManager, getSubqueryForVariable, getTimeoutMillis, getType, getUpdate, hashCode, hasSubqueryForVariable, isSubclasses, isUnique, isUnmodifiable, performExecuteInternal, performExecuteTask, prepareDatastore, resolveClassDeclaration, setCandidateClassName, setClass, setExtensions, setFetchPlan, setFilter, setFrom, setGrouping, setHaving, setIgnoreCache, setImplicitParameter, setImplicitParameter, setOrdering, setRange, setRange, setResult, setResultClass, setResultClassName, setResultDistinct, setResultMetaData, setSerializeRead, setSubclasses, setTimeoutMillis, setType, setUnique, setUnmodifiable, setUpdate, useFetchPlan
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER_NEODATIS

protected static final org.datanucleus.util.Localiser LOCALISER_NEODATIS
Localiser for messages.

Constructor Detail

CriteriaQuery

public CriteriaQuery(org.datanucleus.ObjectManager om)
Constructs a new query instance that uses the given persistence manager.

Parameters:
om - the associated ObjectManager for this query.

CriteriaQuery

public CriteriaQuery(org.datanucleus.ObjectManager om,
                     java.lang.Object criteriaQuery)
Constructor for a query using NeoDatis "native" query language. The second parameter must implement "org.neodatis.odb.impl.core.query.criteria.CriteriaQuery".

Parameters:
om - The persistence manager
criteriaQuery - The criteria query
Throws:
org.datanucleus.exceptions.NucleusUserException - When the second parameter isn't an implementation of a Query
Method Detail

compileInternal

protected void compileInternal(boolean forExecute,
                               java.util.Map parameterValues)
Method to compile the query. We have nothing to compile with NeoDatis criteria queries since all is done at execution.

Specified by:
compileInternal in class org.datanucleus.store.query.Query
Parameters:
forExecute - Whether to compile ready for execution

isCompiled

protected boolean isCompiled()
Method to return if the query is compiled.

Overrides:
isCompiled in class org.datanucleus.store.query.Query
Returns:
Whether it is compiled

performExecute

protected java.lang.Object performExecute(java.util.Map parameters)
Method to execute the query.

Specified by:
performExecute in class org.datanucleus.store.query.Query
Parameters:
parameters - Map of parameter values keyed by the name
Returns:
The query result

shouldReturnSingleRow

protected boolean shouldReturnSingleRow()
Convenience method to return whether the query should return a single row.

Overrides:
shouldReturnSingleRow in class org.datanucleus.store.query.Query
Returns:
Whether a single row should result

getSingleStringQuery

public java.lang.String getSingleStringQuery()
Method to return the query as a single string.

Specified by:
getSingleStringQuery in class org.datanucleus.store.query.AbstractJavaQuery
Returns:
The single string


Copyright © 2009. All Rights Reserved.