Package org.apache.openjpa.jdbc.kernel
Class SQLStoreQuery.SQLExecutor
java.lang.Object
org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
org.apache.openjpa.jdbc.kernel.SQLStoreQuery.SQLExecutor
- All Implemented Interfaces:
StoreQuery.Executor
- Enclosing class:
- SQLStoreQuery
Executes the filter as a SQL query.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ResultSetexecuteQuery(JDBCStore store, Connection conn, PreparedStatement stmnt, SQLBuffer buf, List paramList) This method is to provide override for non-JDBC or JDBC-like implementation of executing query.executeQuery(StoreQuery q, Object[] params, StoreQuery.Range range) Return the result of executing this query with the given parameter values.protected intexecuteUpdate(JDBCStore store, Connection conn, PreparedStatement stmnt, SQLBuffer buf) This method is to provide override for non-JDBC or JDBC-like implementation of executing update.executeUpdate(StoreQuery q, Object[] params) Updates the objects that result from the execution of the query, retuning the number of objects that were updated.String[]getDataStoreActions(StoreQuery q, Object[] params, StoreQuery.Range range) Return a description of the commands that will be sent to the datastore in order to execute the query.intReturns the operation this executor is meant to execute.booleanReturn true if this executor packs projections into the result class itself.protected PreparedStatementprepareCall(Connection conn, SQLBuffer buf) This method is to provide override for non-JDBC or JDBC-like implementation of preparing call statement.protected PreparedStatementprepareCall(Connection conn, SQLBuffer buf, JDBCFetchConfiguration fetch, int rsType, int rsConcur) This method is to provide override for non-JDBC or JDBC-like implementation of preparing call statement.protected PreparedStatementprepareStatement(Connection conn, SQLBuffer buf) This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.protected PreparedStatementprepareStatement(Connection conn, SQLBuffer buf, JDBCFetchConfiguration fetch, int rsType, int rsConcur) This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.Object[]toParameterArray(StoreQuery q, Map userParams) The given query is parsed to find the parameter tokens of the form?Methods inherited from class org.apache.openjpa.kernel.AbstractStoreQuery.AbstractExecutor
executeDelete, getAccessPathMetaDatas, getAlias, getAscending, getOrderedParameterTypes, getOrderingValue, getParameterTypes, getProjectionAliases, getProjectionTypes, getQueryExpressions, getRange, getResultClass, getResultShape, getUpdates, hasGrouping, isAggregate, isDistinct, validate
-
Constructor Details
-
SQLExecutor
-
-
Method Details
-
getOperation
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:
-
executeUpdate
Description copied from interface:StoreQuery.ExecutorUpdates the objects that result from the execution of the query, retuning the number of objects that were updated.- Specified by:
executeUpdatein interfaceStoreQuery.Executor- Overrides:
executeUpdatein classAbstractStoreQuery.AbstractExecutor
-
executeQuery
Description copied from interface:StoreQuery.ExecutorReturn 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. -
getDataStoreActions
Description copied from interface:StoreQuery.ExecutorReturn a description of the commands that will be sent to the datastore in order to execute the query.- Specified by:
getDataStoreActionsin interfaceStoreQuery.Executor- Overrides:
getDataStoreActionsin classAbstractStoreQuery.AbstractExecutor
-
isPacking
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
-
prepareCall
This method is to provide override for non-JDBC or JDBC-like implementation of preparing call statement.- Throws:
SQLException
-
executeUpdate
protected int executeUpdate(JDBCStore store, Connection conn, PreparedStatement stmnt, SQLBuffer buf) throws SQLException This method is to provide override for non-JDBC or JDBC-like implementation of executing update.- Throws:
SQLException
-
prepareCall
protected PreparedStatement prepareCall(Connection conn, SQLBuffer buf, JDBCFetchConfiguration fetch, int rsType, int rsConcur) throws SQLException This method is to provide override for non-JDBC or JDBC-like implementation of preparing call statement.- Throws:
SQLException
-
prepareStatement
This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(Connection conn, SQLBuffer buf, JDBCFetchConfiguration fetch, int rsType, int rsConcur) throws SQLException This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.- Throws:
SQLException
-
executeQuery
protected ResultSet executeQuery(JDBCStore store, Connection conn, PreparedStatement stmnt, SQLBuffer buf, List paramList) throws SQLException This method is to provide override for non-JDBC or JDBC-like implementation of executing query.- Throws:
SQLException
-
toParameterArray
The given query is parsed to find the parameter tokens of the form?nwhich is different than?tokens in actual SQL parameter tokens. These?nstyle tokens are replaced in the query string by?tokens. During the token parsing, the ordering of the tokens is recorded. The given userParam must contain parameter keys as Integer and the same Integers must appear in the tokens.- Returns:
- array with parameter values ordered in the same way as this receiver's executeXXX() method expects.
-