Class JPQLInMemoryEvaluator
java.lang.Object
org.datanucleus.store.query.inmemory.JavaQueryInMemoryEvaluator
org.datanucleus.store.query.inmemory.JPQLInMemoryEvaluator
Class to evaluate a JPQL query in whole or part.
-
Field Summary
Fields inherited from class org.datanucleus.store.query.inmemory.JavaQueryInMemoryEvaluator
candidateAlias, candidates, clr, compilation, evaluator, language, parameterValues, query, RESULTS_SET, state
-
Constructor Summary
ConstructorsConstructorDescriptionJPQLInMemoryEvaluator
(Query query, Collection candidates, QueryCompilation compilation, Map parameterValues, ClassLoaderResolver clr) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
evaluateSubquery
(Query query, QueryCompilation compilation, Collection candidates, Object outerCandidate) Method to evaluate a subquery of the query being evaluated.execute
(boolean applyFilter, boolean applyOrdering, boolean applyResult, boolean applyResultClass, boolean applyRange) Method to perform the evaluation, applying the query restrictions that are required.(package private) Collection
mapResultClass
(Collection resultSet) Constructs ResultClassMapper and calls its map function.
-
Constructor Details
-
JPQLInMemoryEvaluator
public JPQLInMemoryEvaluator(Query query, Collection candidates, QueryCompilation compilation, Map parameterValues, ClassLoaderResolver clr) Constructor.- Parameters:
query
- The underlying JPQL querycandidates
- List of objects as input to the evaluation processcompilation
- Compiled queryparameterValues
- Input parameter valuesclr
- ClassLoader resolver
-
-
Method Details
-
evaluateSubquery
protected Collection evaluateSubquery(Query query, QueryCompilation compilation, Collection candidates, Object outerCandidate) Method to evaluate a subquery of the query being evaluated.- Specified by:
evaluateSubquery
in classJavaQueryInMemoryEvaluator
- Parameters:
query
- The subquerycompilation
- The subquery compilationcandidates
- The candidates for the subqueryouterCandidate
- Current candidate in the outer query (for use when linking back)- Returns:
- The result
-
execute
public Collection execute(boolean applyFilter, boolean applyOrdering, boolean applyResult, boolean applyResultClass, boolean applyRange) Description copied from class:JavaQueryInMemoryEvaluator
Method to perform the evaluation, applying the query restrictions that are required.- Overrides:
execute
in classJavaQueryInMemoryEvaluator
- 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.
-
mapResultClass
Constructs ResultClassMapper and calls its map function.- Specified by:
mapResultClass
in classJavaQueryInMemoryEvaluator
- Parameters:
resultSet
- The resultSet containing the instances handled by setResult- Returns:
- The resultSet containing instances of the Class defined by setResultClass
-