com.jpattern.orm.query.sql
Interface SqlExecutor

All Known Implementing Classes:
PlainSqlExecutor

public interface SqlExecutor

Author:
Francesco Cina 09/lug/2011

Method Summary
 SqlBatchUpdateQuery batchUpdate(List<String> sqls)
          Issue multiple SQL updates on a single JDBC Statement using batching.
 SqlBatchUpdateQuery batchUpdate(String sql, BatchPreparedStatementSetter psc)
          Issue multiple SQL updates on a single JDBC Statement using batching.
 SqlBatchUpdateQuery batchUpdate(String sql, List<Object[]> args)
          Issue multiple SQL updates on a single JDBC Statement using batching.
 SqlExecuteQuery executeQuery(String sql)
          Issue a single SQL execute, typically a DDL statement.
 SqlFindQuery findQuery(String sql, Object... args)
          Perform a single SQL select operation.
 SqlUpdateQuery updateQuery(String sql, GeneratedKeyReader generatedKeyReader, Object... args)
          Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters.
 SqlUpdateQuery updateQuery(String sql, Object... args)
          Perform a single SQL update operation (such as an insert, update or delete statement).
 

Method Detail

findQuery

SqlFindQuery findQuery(String sql,
                       Object... args)
Perform a single SQL select operation.

Parameters:
sql - static SQL to execute
args - arguments to bind to the query
Returns:

executeQuery

SqlExecuteQuery executeQuery(String sql)
                             throws OrmException
Issue a single SQL execute, typically a DDL statement.

Parameters:
sql - static SQL to execute
Throws:
OrmException

updateQuery

SqlUpdateQuery updateQuery(String sql,
                           Object... args)
                           throws OrmException
Perform a single SQL update operation (such as an insert, update or delete statement).

Parameters:
sql - static SQL to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

updateQuery

SqlUpdateQuery updateQuery(String sql,
                           GeneratedKeyReader generatedKeyReader,
                           Object... args)
                           throws OrmException
Issue an update statement using a PreparedStatementCreator to provide SQL and any required parameters. Generated keys can be read using the IGeneratedKeyReader.

Parameters:
psc - object that provides SQL and any necessary parameters
generatedKeyReader - IGeneratedKeyReader to read the generated key
Returns:
Throws:
OrmException

batchUpdate

SqlBatchUpdateQuery batchUpdate(List<String> sqls)
                                throws OrmException
Issue multiple SQL updates on a single JDBC Statement using batching.

Parameters:
sql - defining a List of SQL statements that will be executed.
Returns:
Throws:
OrmException

batchUpdate

SqlBatchUpdateQuery batchUpdate(String sql,
                                List<Object[]> args)
                                throws OrmException
Issue multiple SQL updates on a single JDBC Statement using batching. The same query is executed for every Object array present in the args list which is the list of arguments to bind to the query.

Parameters:
sql - defining a List of SQL statements that will be executed.
args - defining a List of Object arrays to bind to the query.
Returns:
Throws:
OrmException

batchUpdate

SqlBatchUpdateQuery batchUpdate(String sql,
                                BatchPreparedStatementSetter psc)
                                throws OrmException
Issue multiple SQL updates on a single JDBC Statement using batching. The values on the generated PreparedStatement are set using an IPreparedStatementCreator.

Parameters:
sql - defining a List of SQL statements that will be executed.
psc - the creator to bind values on the PreparedStatement
Returns:
Throws:
OrmException


Copyright © 2013. All Rights Reserved.