org.apache.openjpa.jdbc.kernel
Class PreparedSQLStoreQuery.PreparedSQLExecutor

java.lang.Object
  extended by org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
      extended by org.apache.openjpa.kernel.ExpressionStoreQuery.AbstractExpressionExecutor
          extended by org.apache.openjpa.jdbc.kernel.PreparedSQLStoreQuery.PreparedSQLExecutor
All Implemented Interfaces:
StoreQuery.Executor
Enclosing class:
PreparedSQLStoreQuery

public static class PreparedSQLStoreQuery.PreparedSQLExecutor
extends ExpressionStoreQuery.AbstractExpressionExecutor

Executor of a prepared query uses the QueryExpressions of the original query available via the PreparedQuery.


Constructor Summary
PreparedSQLStoreQuery.PreparedSQLExecutor(PreparedSQLStoreQuery q, ClassMetaData candidate)
           
 
Method Summary
 ResultObjectProvider executeQuery(StoreQuery q, Object[] params, StoreQuery.Range range)
          Return the result of executing this query with the given parameter values.
 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.
 Object[] toParameterArray(StoreQuery q, Map userParams)
          Convert given userParams to an array whose ordering matches as per expected during executeXXX() methods.
 
Methods inherited from class org.apache.openjpa.kernel.ExpressionStoreQuery.AbstractExpressionExecutor
assertNotContainer, getAccessPathMetaDatas, getAlias, getAscending, getOperation, getOrderedParameterTypes, getProjectionAliases, getRange, getResultClass, getResultShape, getUpdates, hasGrouping, isAggregate, isDistinct, isPacking, validate
 
Methods inherited from class org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
executeDelete, executeUpdate, getDataStoreActions, getOrderingValue, getParameterTypes
 
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, executeUpdate, getDataStoreActions, getOrderingValue, getParameterTypes
 

Constructor Detail

PreparedSQLStoreQuery.PreparedSQLExecutor

public PreparedSQLStoreQuery.PreparedSQLExecutor(PreparedSQLStoreQuery q,
                                                 ClassMetaData candidate)
Method Detail

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

getProjectionTypes

public 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 interface StoreQuery.Executor
Overrides:
getProjectionTypes in class ExpressionStoreQuery.AbstractExpressionExecutor

executeQuery

public ResultObjectProvider executeQuery(StoreQuery q,
                                         Object[] params,
                                         StoreQuery.Range range)
Description copied from interface: StoreQuery.Executor
Return the result of executing this query with the given parameter values. If this query is a projection and this executor does not pack results itself, each element of the returned result object provider should be an object array containing the projection values.

See Also:
StoreQuery.Executor.isPacking(org.apache.openjpa.kernel.StoreQuery)

toParameterArray

public Object[] toParameterArray(StoreQuery q,
                                 Map userParams)
Convert given userParams to an array whose ordering matches as per expected during executeXXX() methods. The given userParams is already re-parameterized, so this method have to merely copy the given Map values.

Specified by:
toParameterArray in interface StoreQuery.Executor
Overrides:
toParameterArray in class ExpressionStoreQuery.AbstractExpressionExecutor
Returns:
array with parameter values ordered in the same way as this receiver's executeXXX() method expects.
See Also:
PreparedQueryImpl.reparametrize(Map, org.apache.openjpa.kernel.Broker)


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