パッケージ org.nkjmlab.sorm4j
インタフェース SqlExecutor
- 既知のサブインタフェースのリスト:
Orm
,OrmConnection
,OrmConnectionCommon
,OrmTransaction
,Sorm
public interface SqlExecutor
A interface for executing SQL with parameters.
- 作成者:
- nkjm
-
メソッドの概要
修飾子とタイプメソッド説明void
Accepts handler forPreparedStatement
which has sets the given parameters.<T> T
applyPreparedStatementHandler
(ParameterizedSql sql, FunctionHandler<PreparedStatement, T> handler) Applies handler forPreparedStatement
which has sets the given parameters.<T> T
executeQuery
(ParameterizedSql sql, ResultSetTraverser<T> traverser) Executes a query and apply the givenResultSetTraverser
to the returned result set.<T> List<T>
executeQuery
(ParameterizedSql sql, RowMapper<T> mapper) Executes a query and apply the givenRowMapper
to the each row in returned result set.int
executeUpdate
(String sql, Object... parameters) Executes an update and returns the number of rows modified.int
-
メソッドの詳細
-
acceptPreparedStatementHandler
void acceptPreparedStatementHandler(ParameterizedSql sql, ConsumerHandler<PreparedStatement> handler) Accepts handler forPreparedStatement
which has sets the given parameters.- パラメータ:
sql
-handler
-
-
applyPreparedStatementHandler
<T> T applyPreparedStatementHandler(ParameterizedSql sql, FunctionHandler<PreparedStatement, T> handler) Applies handler forPreparedStatement
which has sets the given parameters.- 型パラメータ:
T
-- パラメータ:
sql
-handler
-- 戻り値:
-
executeQuery
Executes a query and apply the givenResultSetTraverser
to the returned result set.This method wraps
Statement.executeQuery(String)
Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(SormOptions, PreparedStatement, Object...)
- 型パラメータ:
T
-- パラメータ:
sql
- SQL code to be executed.traverser
-- 戻り値:
-
executeQuery
Executes a query and apply the givenRowMapper
to the each row in returned result set.- 型パラメータ:
T
-- パラメータ:
sql
-mapper
-- 戻り値:
-
executeUpdate
Executes an update and returns the number of rows modified.This method wraps
Statement.executeUpdate(String)
Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(SormOptions, PreparedStatement, Object...)
- パラメータ:
sql
- SQL code to be executed.parameters
- Parameters to be used in the PreparedStatement.
-
executeUpdate
- パラメータ:
sql
-- 戻り値:
-