Package org.apache.openjpa.kernel
Class ExpressionStoreQuery.AbstractExpressionExecutor
- java.lang.Object
-
- org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
-
- org.apache.openjpa.kernel.ExpressionStoreQuery.AbstractExpressionExecutor
-
- All Implemented Interfaces:
StoreQuery.Executor
- Direct Known Subclasses:
ExpressionStoreQuery.DataStoreExecutor
,ExpressionStoreQuery.InMemoryExecutor
,PreparedSQLStoreQuery.PreparedSQLExecutor
- Enclosing class:
- ExpressionStoreQuery
public abstract static class ExpressionStoreQuery.AbstractExpressionExecutor extends AbstractStoreQuery.AbstractExecutor implements StoreQuery.Executor
Provides support for queries that hold query information in aQueryExpressions
instance.- Author:
- Marc Prud'hommeaux
-
-
Constructor Summary
Constructors Constructor Description AbstractExpressionExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
assertNotContainer(Value val, StoreQuery q)
Throw proper exception if given value is a collection/map/array.ClassMetaData[]
getAccessPathMetaDatas(StoreQuery q)
Return an array of all persistent classes used in this query, or empty array if unknown.java.lang.String
getAlias(StoreQuery q)
If this is not a projection but the candidate results are placed into a result class with an alias, return that alias.boolean[]
getAscending(StoreQuery q)
Return the ordering direction for all ordering clauses, or empty array if none.int
getOperation(StoreQuery q)
Returns the operation this executor is meant to execute.OrderedMap<java.lang.Object,java.lang.Class<?>>
getOrderedParameterTypes(StoreQuery q)
Return a map of parameter names to types.java.lang.String[]
getProjectionAliases(StoreQuery q)
Return the alias for each projection element, or empty array if not a projection.java.lang.Class<?>[]
getProjectionTypes(StoreQuery q)
Return the expected types of the projections used by this query, or an empty array if not a projection.void
getRange(StoreQuery q, java.lang.Object[] params, StoreQuery.Range range)
Mutate the given range to set any range information stored in the query string and/or parameters.java.lang.Class<?>
getResultClass(StoreQuery q)
Returns the result class, if any.ResultShape<?>
getResultShape(StoreQuery q)
java.util.Map
getUpdates(StoreQuery q)
Return a map ofFieldMetaData
to updateConstant
s, in cases where this query is for a bulk update.boolean
hasGrouping(StoreQuery q)
Whether the compiled query has grouping.boolean
isAggregate(StoreQuery q)
Return true if the compiled query is an aggregate.boolean
isDistinct(StoreQuery q)
boolean
isPacking(StoreQuery q)
Return true if this executor packs projections into the result class itself.java.lang.Object[]
toParameterArray(StoreQuery q, java.util.Map<?,?> userParams)
Creates a Object[] from the values of the given user parameters.void
validate(StoreQuery q)
Validate components of query.-
Methods inherited from class org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
executeDelete, executeUpdate, getDataStoreActions, getOrderingValue, getParameterTypes, getQueryExpressions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.kernel.StoreQuery.Executor
executeDelete, executeQuery, executeUpdate, getDataStoreActions, getOrderingValue, getParameterTypes, getQueryExpressions
-
-
-
-
Method Detail
-
assertNotContainer
protected void assertNotContainer(Value val, StoreQuery q)
Throw proper exception if given value is a collection/map/array.
-
validate
public final void validate(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Validate components of query.- Specified by:
validate
in interfaceStoreQuery.Executor
- Overrides:
validate
in classAbstractStoreQuery.AbstractExecutor
-
getRange
public void getRange(StoreQuery q, java.lang.Object[] params, StoreQuery.Range range)
Description copied from interface:StoreQuery.Executor
Mutate the given range to set any range information stored in the query string and/or parameters.- Specified by:
getRange
in interfaceStoreQuery.Executor
- Overrides:
getRange
in classAbstractStoreQuery.AbstractExecutor
-
getResultClass
public final java.lang.Class<?> getResultClass(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Returns the result class, if any.- Specified by:
getResultClass
in interfaceStoreQuery.Executor
- Overrides:
getResultClass
in classAbstractStoreQuery.AbstractExecutor
-
getResultShape
public final ResultShape<?> getResultShape(StoreQuery q)
- Specified by:
getResultShape
in interfaceStoreQuery.Executor
- Overrides:
getResultShape
in classAbstractStoreQuery.AbstractExecutor
-
getAscending
public final boolean[] getAscending(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return the ordering direction for all ordering clauses, or empty array if none.- Specified by:
getAscending
in interfaceStoreQuery.Executor
- Overrides:
getAscending
in classAbstractStoreQuery.AbstractExecutor
-
getAlias
public final java.lang.String getAlias(StoreQuery q)
Description copied from interface:StoreQuery.Executor
If this is not a projection but the candidate results are placed into a result class with an alias, return that alias.- Specified by:
getAlias
in interfaceStoreQuery.Executor
- Overrides:
getAlias
in classAbstractStoreQuery.AbstractExecutor
-
getProjectionAliases
public final java.lang.String[] getProjectionAliases(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return the alias for each projection element, or empty array if not a projection.- Specified by:
getProjectionAliases
in interfaceStoreQuery.Executor
- Overrides:
getProjectionAliases
in classAbstractStoreQuery.AbstractExecutor
-
getProjectionTypes
public java.lang.Class<?>[] getProjectionTypes(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return the expected types of the projections used by this query, or an empty array if not a projection.- Specified by:
getProjectionTypes
in interfaceStoreQuery.Executor
- Overrides:
getProjectionTypes
in classAbstractStoreQuery.AbstractExecutor
-
getOperation
public final int getOperation(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Returns the operation this executor is meant to execute.- Specified by:
getOperation
in interfaceStoreQuery.Executor
- Overrides:
getOperation
in classAbstractStoreQuery.AbstractExecutor
- See Also:
QueryOperations
-
isAggregate
public final boolean isAggregate(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return true if the compiled query is an aggregate.- Specified by:
isAggregate
in interfaceStoreQuery.Executor
- Overrides:
isAggregate
in classAbstractStoreQuery.AbstractExecutor
-
isDistinct
public final boolean isDistinct(StoreQuery q)
- Specified by:
isDistinct
in interfaceStoreQuery.Executor
- Overrides:
isDistinct
in classAbstractStoreQuery.AbstractExecutor
-
hasGrouping
public final boolean hasGrouping(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Whether the compiled query has grouping.- Specified by:
hasGrouping
in interfaceStoreQuery.Executor
- Overrides:
hasGrouping
in classAbstractStoreQuery.AbstractExecutor
-
getOrderedParameterTypes
public final OrderedMap<java.lang.Object,java.lang.Class<?>> getOrderedParameterTypes(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return a map of parameter names to types. The returnedMap.entrySet()
'sIterator
must return values in the order in which they were declared or used.- Specified by:
getOrderedParameterTypes
in interfaceStoreQuery.Executor
- Overrides:
getOrderedParameterTypes
in classAbstractStoreQuery.AbstractExecutor
-
toParameterArray
public java.lang.Object[] toParameterArray(StoreQuery q, java.util.Map<?,?> userParams)
Creates a Object[] from the values of the given user parameters.- Specified by:
toParameterArray
in interfaceStoreQuery.Executor
- Returns:
- array with parameter values ordered in the same way as this receiver's executeXXX() method expects.
-
getUpdates
public final java.util.Map getUpdates(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return a map ofFieldMetaData
to updateConstant
s, in cases where this query is for a bulk update.- Specified by:
getUpdates
in interfaceStoreQuery.Executor
- Overrides:
getUpdates
in classAbstractStoreQuery.AbstractExecutor
-
getAccessPathMetaDatas
public final ClassMetaData[] getAccessPathMetaDatas(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return an array of all persistent classes used in this query, or empty array if unknown.- Specified by:
getAccessPathMetaDatas
in interfaceStoreQuery.Executor
- Overrides:
getAccessPathMetaDatas
in classAbstractStoreQuery.AbstractExecutor
-
isPacking
public boolean isPacking(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Return true if this executor packs projections into the result class itself. Executors for query languages that allow projections without result clauses must return true and perform the result packing themselves.- Specified by:
isPacking
in interfaceStoreQuery.Executor
- Overrides:
isPacking
in classAbstractStoreQuery.AbstractExecutor
-
-