com.jpattern.orm.query.sql
Class PlainSqlExecutor

java.lang.Object
  extended by com.jpattern.orm.query.sql.PlainSqlExecutor
All Implemented Interfaces:
SqlExecutor

public class PlainSqlExecutor
extends Object
implements SqlExecutor

Author:
Francesco Cina 09/lug/2011

Constructor Summary
PlainSqlExecutor(SessionSqlPerformer session)
           
 
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainSqlExecutor

public PlainSqlExecutor(SessionSqlPerformer session)
Method Detail

findQuery

public SqlFindQuery findQuery(String sql,
                              Object... args)
Description copied from interface: SqlExecutor
Perform a single SQL select operation.

Specified by:
findQuery in interface SqlExecutor
Parameters:
sql - static SQL to execute
args - arguments to bind to the query
Returns:

executeQuery

public SqlExecuteQuery executeQuery(String sql)
                             throws OrmException
Description copied from interface: SqlExecutor
Issue a single SQL execute, typically a DDL statement.

Specified by:
executeQuery in interface SqlExecutor
Parameters:
sql - static SQL to execute
Throws:
OrmException

updateQuery

public SqlUpdateQuery updateQuery(String sql,
                                  Object... args)
                           throws OrmException
Description copied from interface: SqlExecutor
Perform a single SQL update operation (such as an insert, update or delete statement).

Specified by:
updateQuery in interface SqlExecutor
Parameters:
sql - static SQL to execute
args - arguments to bind to the query
Returns:
Throws:
OrmException

updateQuery

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

Specified by:
updateQuery in interface SqlExecutor
generatedKeyReader - IGeneratedKeyReader to read the generated key
Returns:
Throws:
OrmException

batchUpdate

public SqlBatchUpdateQuery batchUpdate(List<String> sqls)
                                throws OrmException
Description copied from interface: SqlExecutor
Issue multiple SQL updates on a single JDBC Statement using batching.

Specified by:
batchUpdate in interface SqlExecutor
Returns:
Throws:
OrmException

batchUpdate

public SqlBatchUpdateQuery batchUpdate(String sql,
                                       List<Object[]> args)
                                throws OrmException
Description copied from interface: SqlExecutor
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.

Specified by:
batchUpdate in interface SqlExecutor
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

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

Specified by:
batchUpdate in interface SqlExecutor
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.