Package org.apache.openjpa.kernel
Class AbstractStoreQuery.AbstractExecutor
- java.lang.Object
-
- org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
-
- All Implemented Interfaces:
StoreQuery.Executor
- Direct Known Subclasses:
ExpressionStoreQuery.AbstractExpressionExecutor
,SQLStoreQuery.SQLExecutor
,StoredProcedureQuery.StoredProcedureQueryExecutor
- Enclosing class:
- AbstractStoreQuery
public abstract static class AbstractStoreQuery.AbstractExecutor extends java.lang.Object implements StoreQuery.Executor
AbstractStoreQuery.Executor
that implements most methods as no-ops.
-
-
Constructor Summary
Constructors Constructor Description AbstractExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
executeDelete(StoreQuery q, java.lang.Object[] params)
Deleted the objects that result from the execution of the query, retuning the number of objects that were deleted.java.lang.Number
executeUpdate(StoreQuery q, java.lang.Object[] params)
Updates the objects that result from the execution of the query, retuning the number of objects that were updated.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.java.lang.String[]
getDataStoreActions(StoreQuery q, java.lang.Object[] params, StoreQuery.Range range)
Return a description of the commands that will be sent to the datastore in order to execute the query.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.Object
getOrderingValue(StoreQuery q, java.lang.Object[] params, java.lang.Object resultObject, int orderIndex)
Extract the value of theorderIndex
th ordering expression inQuery#getOrderingClauses
from the given result object.LinkedMap
getParameterTypes(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.QueryExpressions[]
getQueryExpressions()
Return the parsed query expressions for our candidate types.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<FieldMetaData,Value>
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.void
validate(StoreQuery q)
Validate components of query.-
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
executeQuery, toParameterArray
-
-
-
-
Method Detail
-
executeDelete
public java.lang.Number executeDelete(StoreQuery q, java.lang.Object[] params)
Description copied from interface:StoreQuery.Executor
Deleted the objects that result from the execution of the query, retuning the number of objects that were deleted.- Specified by:
executeDelete
in interfaceStoreQuery.Executor
-
executeUpdate
public java.lang.Number executeUpdate(StoreQuery q, java.lang.Object[] params)
Description copied from interface:StoreQuery.Executor
Updates the objects that result from the execution of the query, retuning the number of objects that were updated.- Specified by:
executeUpdate
in interfaceStoreQuery.Executor
-
getDataStoreActions
public java.lang.String[] getDataStoreActions(StoreQuery q, java.lang.Object[] params, StoreQuery.Range range)
Description copied from interface:StoreQuery.Executor
Return a description of the commands that will be sent to the datastore in order to execute the query.- Specified by:
getDataStoreActions
in interfaceStoreQuery.Executor
-
validate
public void validate(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Validate components of query.- Specified by:
validate
in interfaceStoreQuery.Executor
-
getQueryExpressions
public QueryExpressions[] getQueryExpressions()
Description copied from interface:StoreQuery.Executor
Return the parsed query expressions for our candidate types. The expressions are available only after query has been parsed.- Specified by:
getQueryExpressions
in interfaceStoreQuery.Executor
-
getResultShape
public ResultShape<?> getResultShape(StoreQuery q)
- Specified by:
getResultShape
in interfaceStoreQuery.Executor
-
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
-
getOrderingValue
public java.lang.Object getOrderingValue(StoreQuery q, java.lang.Object[] params, java.lang.Object resultObject, int orderIndex)
Description copied from interface:StoreQuery.Executor
Extract the value of theorderIndex
th ordering expression inQuery#getOrderingClauses
from the given result object. The result object will be an object from the result object provider returned fromStoreQuery.Executor.executeQuery(org.apache.openjpa.kernel.StoreQuery, java.lang.Object[], org.apache.openjpa.kernel.StoreQuery.Range)
. This method is used when several result lists have to be merged in memory. If this exeuctor's parent query supports executors on abstract or interface classes, this method will not be used.- Specified by:
getOrderingValue
in interfaceStoreQuery.Executor
- See Also:
StoreQuery.supportsAbstractExecutors()
-
getAscending
public 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
-
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
-
getAlias
public 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
-
getProjectionAliases
public 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
-
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
-
getAccessPathMetaDatas
public 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
-
getOperation
public 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
- See Also:
QueryOperations
-
isAggregate
public 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
-
isDistinct
public boolean isDistinct(StoreQuery q)
- Specified by:
isDistinct
in interfaceStoreQuery.Executor
-
hasGrouping
public boolean hasGrouping(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Whether the compiled query has grouping.- Specified by:
hasGrouping
in interfaceStoreQuery.Executor
-
getOrderedParameterTypes
public 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
-
getParameterTypes
public LinkedMap getParameterTypes(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.
Warning: Deprecated. Use StoreQuery.Executor.getOrderedParameterTypes(StoreQuery) instead.- Specified by:
getParameterTypes
in interfaceStoreQuery.Executor
-
getResultClass
public java.lang.Class<?> getResultClass(StoreQuery q)
Description copied from interface:StoreQuery.Executor
Returns the result class, if any.- Specified by:
getResultClass
in interfaceStoreQuery.Executor
-
getUpdates
public java.util.Map<FieldMetaData,Value> 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
-
-