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 aQueryExpressionsinstance.- Author:
- Marc Prud'hommeaux
-
-
Constructor Summary
Constructors Constructor Description AbstractExpressionExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertNotContainer(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.StringgetAlias(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.intgetOperation(StoreQuery q)Returns the operation this executor is meant to execute.OrderedMap<Object,Class<?>>getOrderedParameterTypes(StoreQuery q)Return a map of parameter names to types.String[]getProjectionAliases(StoreQuery q)Return the alias for each projection element, or empty array if not a projection.Class<?>[]getProjectionTypes(StoreQuery q)Return the expected types of the projections used by this query, or an empty array if not a projection.voidgetRange(StoreQuery q, Object[] params, StoreQuery.Range range)Mutate the given range to set any range information stored in the query string and/or parameters.Class<?>getResultClass(StoreQuery q)Returns the result class, if any.ResultShape<?>getResultShape(StoreQuery q)MapgetUpdates(StoreQuery q)Return a map ofFieldMetaDatato updateConstants, in cases where this query is for a bulk update.booleanhasGrouping(StoreQuery q)Whether the compiled query has grouping.booleanisAggregate(StoreQuery q)Return true if the compiled query is an aggregate.booleanisDistinct(StoreQuery q)booleanisPacking(StoreQuery q)Return true if this executor packs projections into the result class itself.Object[]toParameterArray(StoreQuery q, Map<?,?> userParams)Creates a Object[] from the values of the given user parameters.voidvalidate(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.ExecutorValidate components of query.- Specified by:
validatein interfaceStoreQuery.Executor- Overrides:
validatein classAbstractStoreQuery.AbstractExecutor
-
getRange
public void getRange(StoreQuery q, Object[] params, StoreQuery.Range range)
Description copied from interface:StoreQuery.ExecutorMutate the given range to set any range information stored in the query string and/or parameters.- Specified by:
getRangein interfaceStoreQuery.Executor- Overrides:
getRangein classAbstractStoreQuery.AbstractExecutor
-
getResultClass
public final Class<?> getResultClass(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturns the result class, if any.- Specified by:
getResultClassin interfaceStoreQuery.Executor- Overrides:
getResultClassin classAbstractStoreQuery.AbstractExecutor
-
getResultShape
public final ResultShape<?> getResultShape(StoreQuery q)
- Specified by:
getResultShapein interfaceStoreQuery.Executor- Overrides:
getResultShapein classAbstractStoreQuery.AbstractExecutor
-
getAscending
public final boolean[] getAscending(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn the ordering direction for all ordering clauses, or empty array if none.- Specified by:
getAscendingin interfaceStoreQuery.Executor- Overrides:
getAscendingin classAbstractStoreQuery.AbstractExecutor
-
getAlias
public final String getAlias(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorIf this is not a projection but the candidate results are placed into a result class with an alias, return that alias.- Specified by:
getAliasin interfaceStoreQuery.Executor- Overrides:
getAliasin classAbstractStoreQuery.AbstractExecutor
-
getProjectionAliases
public final String[] getProjectionAliases(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn the alias for each projection element, or empty array if not a projection.- Specified by:
getProjectionAliasesin interfaceStoreQuery.Executor- Overrides:
getProjectionAliasesin classAbstractStoreQuery.AbstractExecutor
-
getProjectionTypes
public Class<?>[] getProjectionTypes(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn the expected types of the projections used by this query, or an empty array if not a projection.- Specified by:
getProjectionTypesin interfaceStoreQuery.Executor- Overrides:
getProjectionTypesin classAbstractStoreQuery.AbstractExecutor
-
getOperation
public final int getOperation(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturns the operation this executor is meant to execute.- Specified by:
getOperationin interfaceStoreQuery.Executor- Overrides:
getOperationin classAbstractStoreQuery.AbstractExecutor- See Also:
QueryOperations
-
isAggregate
public final boolean isAggregate(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn true if the compiled query is an aggregate.- Specified by:
isAggregatein interfaceStoreQuery.Executor- Overrides:
isAggregatein classAbstractStoreQuery.AbstractExecutor
-
isDistinct
public final boolean isDistinct(StoreQuery q)
- Specified by:
isDistinctin interfaceStoreQuery.Executor- Overrides:
isDistinctin classAbstractStoreQuery.AbstractExecutor
-
hasGrouping
public final boolean hasGrouping(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorWhether the compiled query has grouping.- Specified by:
hasGroupingin interfaceStoreQuery.Executor- Overrides:
hasGroupingin classAbstractStoreQuery.AbstractExecutor
-
getOrderedParameterTypes
public final OrderedMap<Object,Class<?>> getOrderedParameterTypes(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn a map of parameter names to types. The returnedMap.entrySet()'sIteratormust return values in the order in which they were declared or used.- Specified by:
getOrderedParameterTypesin interfaceStoreQuery.Executor- Overrides:
getOrderedParameterTypesin classAbstractStoreQuery.AbstractExecutor
-
toParameterArray
public Object[] toParameterArray(StoreQuery q, Map<?,?> userParams)
Creates a Object[] from the values of the given user parameters.- Specified by:
toParameterArrayin interfaceStoreQuery.Executor- Returns:
- array with parameter values ordered in the same way as this receiver's executeXXX() method expects.
-
getUpdates
public final Map getUpdates(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn a map ofFieldMetaDatato updateConstants, in cases where this query is for a bulk update.- Specified by:
getUpdatesin interfaceStoreQuery.Executor- Overrides:
getUpdatesin classAbstractStoreQuery.AbstractExecutor
-
getAccessPathMetaDatas
public final ClassMetaData[] getAccessPathMetaDatas(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn an array of all persistent classes used in this query, or empty array if unknown.- Specified by:
getAccessPathMetaDatasin interfaceStoreQuery.Executor- Overrides:
getAccessPathMetaDatasin classAbstractStoreQuery.AbstractExecutor
-
isPacking
public boolean isPacking(StoreQuery q)
Description copied from interface:StoreQuery.ExecutorReturn 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:
isPackingin interfaceStoreQuery.Executor- Overrides:
isPackingin classAbstractStoreQuery.AbstractExecutor
-
-