Class JavaQueryInMemoryEvaluator
- java.lang.Object
-
- org.datanucleus.store.query.inmemory.JavaQueryInMemoryEvaluator
-
- Direct Known Subclasses:
JDOQLInMemoryEvaluator
,JPQLInMemoryEvaluator
public abstract class JavaQueryInMemoryEvaluator extends Object
Class to evaluate a Java "string-based" query in whole or part. Takes in the "generic" compilation, a list of instances and applies the required restrictions to the input giving a final result. Typically extended for JDOQL, JPQL specifics.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
candidateAlias
protected Collection
candidates
Candidates objects to evaluate.protected ClassLoaderResolver
clr
protected QueryCompilation
compilation
Compilation of the underlying query, that we are evaluating.protected InMemoryExpressionEvaluator
evaluator
The evaluator.protected String
language
protected Map
parameterValues
Map of input parameter values, keyed by the parameter name.protected Query
query
Underlying "string-based" query.static String
RESULTS_SET
Name under which any set of results are stored in the state map.protected Map<String,Object>
state
Map of state symbols for the query evaluation.
-
Constructor Summary
Constructors Constructor Description JavaQueryInMemoryEvaluator(String language, Query query, QueryCompilation compilation, Map parameterValues, ClassLoaderResolver clr, Collection candidates)
Constructor for the evaluator of a query in the specified language.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection
evaluateSubquery(Query subquery, QueryCompilation compilation, Collection candidates, Object outerCandidate)
Method to evaluate a subquery of the query being evaluated.Collection
execute(boolean applyFilter, boolean applyOrdering, boolean applyResult, boolean applyResultClass, boolean applyRange)
Method to perform the evaluation, applying the query restrictions that are required.
-
-
-
Field Detail
-
RESULTS_SET
public static final String RESULTS_SET
Name under which any set of results are stored in the state map. Used for aggregation.- See Also:
- Constant Field Values
-
language
protected final String language
-
candidateAlias
protected String candidateAlias
-
candidates
protected Collection candidates
Candidates objects to evaluate.
-
query
protected Query query
Underlying "string-based" query.
-
compilation
protected QueryCompilation compilation
Compilation of the underlying query, that we are evaluating.
-
parameterValues
protected Map parameterValues
Map of input parameter values, keyed by the parameter name.
-
evaluator
protected InMemoryExpressionEvaluator evaluator
The evaluator.
-
clr
protected ClassLoaderResolver clr
-
-
Constructor Detail
-
JavaQueryInMemoryEvaluator
public JavaQueryInMemoryEvaluator(String language, Query query, QueryCompilation compilation, Map parameterValues, ClassLoaderResolver clr, Collection candidates)
Constructor for the evaluator of a query in the specified language.- Parameters:
language
- Name of the languagequery
- The underlying querycompilation
- Query compilationparameterValues
- Input parameter valuesclr
- ClassLoader resolvercandidates
- Candidate objects
-
-
Method Detail
-
evaluateSubquery
protected abstract Collection evaluateSubquery(Query subquery, QueryCompilation compilation, Collection candidates, Object outerCandidate)
Method to evaluate a subquery of the query being evaluated.- Parameters:
subquery
- The subquerycompilation
- The subquery compilationcandidates
- The candidates for the subqueryouterCandidate
- The current outer candidate (for use when linking back to outer query)- Returns:
- The result
-
execute
public Collection execute(boolean applyFilter, boolean applyOrdering, boolean applyResult, boolean applyResultClass, boolean applyRange)
Method to perform the evaluation, applying the query restrictions that are required.- Parameters:
applyFilter
- Whether to apply any filter constraints on the resultsapplyOrdering
- Whether to apply any order constraints on the resultsapplyResult
- Whether to apply any result/grouping/having on the resultsapplyResultClass
- Whether to apply any resultClass constraint on the resultsapplyRange
- Whether to apply any range constraint on the results- Returns:
- The results after evaluation.
-
-