org.apache.openjpa.kernel
Class ExpressionStoreQuery.AbstractExpressionExecutor

java.lang.Object
  extended by org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
      extended by org.apache.openjpa.kernel.ExpressionStoreQuery.AbstractExpressionExecutor
All Implemented Interfaces:
StoreQuery.Executor
Direct Known Subclasses:
ExpressionStoreQuery.DataStoreExecutor
Enclosing class:
ExpressionStoreQuery

public abstract static class ExpressionStoreQuery.AbstractExpressionExecutor
extends AbstractStoreQuery.AbstractExecutor
implements StoreQuery.Executor

Provides support for queries that hold query information in a QueryExpressions instance.

Author:
Marc Prud'hommeaux

Constructor Summary
ExpressionStoreQuery.AbstractExpressionExecutor()
           
 
Method Summary
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.
 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.
 LinkedMap getParameterTypes(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.
protected abstract  QueryExpressions[] getQueryExpressions()
          Return the parsed query expressions for our candidate types.
 void getRange(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.
 Map getUpdates(StoreQuery q)
          Return a map of FieldMetaData to update Constants, 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 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 org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
executeDelete, executeUpdate, getDataStoreActions, getOrderingValue, getProjectionTypes
 
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, getProjectionTypes
 

Constructor Detail

ExpressionStoreQuery.AbstractExpressionExecutor

public ExpressionStoreQuery.AbstractExpressionExecutor()
Method Detail

getQueryExpressions

protected abstract QueryExpressions[] getQueryExpressions()
Return the parsed query expressions for our candidate types.


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 interface StoreQuery.Executor
Overrides:
validate in class AbstractStoreQuery.AbstractExecutor

getRange

public void getRange(StoreQuery q,
                     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 interface StoreQuery.Executor
Overrides:
getRange in class AbstractStoreQuery.AbstractExecutor

getResultClass

public final Class getResultClass(StoreQuery q)
Description copied from interface: StoreQuery.Executor
Returns the result class, if any.

Specified by:
getResultClass in interface StoreQuery.Executor
Overrides:
getResultClass in class AbstractStoreQuery.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 interface StoreQuery.Executor
Overrides:
getAscending in class AbstractStoreQuery.AbstractExecutor

getAlias

public final 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 interface StoreQuery.Executor
Overrides:
getAlias in class AbstractStoreQuery.AbstractExecutor

getProjectionAliases

public final 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 interface StoreQuery.Executor
Overrides:
getProjectionAliases in class AbstractStoreQuery.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 interface StoreQuery.Executor
Overrides:
getOperation in class AbstractStoreQuery.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 interface StoreQuery.Executor
Overrides:
isAggregate in class AbstractStoreQuery.AbstractExecutor

hasGrouping

public final boolean hasGrouping(StoreQuery q)
Description copied from interface: StoreQuery.Executor
Whether the compiled query has grouping.

Specified by:
hasGrouping in interface StoreQuery.Executor
Overrides:
hasGrouping in class AbstractStoreQuery.AbstractExecutor

getParameterTypes

public final LinkedMap getParameterTypes(StoreQuery q)
Description copied from interface: StoreQuery.Executor
Return a map of parameter names to types. The returned Map.entrySet()'s Iterator must return values in the order in which they were declared or used.

Specified by:
getParameterTypes in interface StoreQuery.Executor
Overrides:
getParameterTypes in class AbstractStoreQuery.AbstractExecutor

getUpdates

public final Map getUpdates(StoreQuery q)
Description copied from interface: StoreQuery.Executor
Return a map of FieldMetaData to update Constants, in cases where this query is for a bulk update.

Specified by:
getUpdates in interface StoreQuery.Executor
Overrides:
getUpdates in class AbstractStoreQuery.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 interface StoreQuery.Executor
Overrides:
getAccessPathMetaDatas in class AbstractStoreQuery.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 interface StoreQuery.Executor
Overrides:
isPacking in class AbstractStoreQuery.AbstractExecutor


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.