パッケージ org.nkjmlab.sorm4j.basic
インタフェース SqlExecutor
-
- 既知のサブインタフェースのリスト:
Orm,OrmConnection,OrmTransaction,Sorm
public interface SqlExecutorA interface for executing SQL with parameters.- 作成者:
- nkjm
-
-
メソッドの概要
すべてのメソッド インスタンス・メソッド abstractメソッド 修飾子とタイプ メソッド 説明 <T> TexecuteQuery(FunctionHandler<Connection,PreparedStatement> statementSupplier, ResultSetTraverser<T> traverser)Executes the query with the given PreparedStatement and applies the given RowMapper.<T> List<T>executeQuery(FunctionHandler<Connection,PreparedStatement> statementSupplier, RowMapper<T> rowMapper)Executes the query with the given PreparedStatement and applies the given RowMapper.<T> TexecuteQuery(ParameterizedSql sql, ResultSetTraverser<T> traverser)Executes a query and apply the givenResultSetTraverserto the returned result set.<T> List<T>executeQuery(ParameterizedSql sql, RowMapper<T> mapper)Executes a query and apply the givenRowMapperto the each row in returned result set.intexecuteUpdate(String sql, Object... parameters)Executes an update and returns the number of rows modified.intexecuteUpdate(ParameterizedSql sql)
-
-
-
メソッドの詳細
-
executeQuery
<T> T executeQuery(FunctionHandler<Connection,PreparedStatement> statementSupplier, ResultSetTraverser<T> traverser)
Executes the query with the given PreparedStatement and applies the given RowMapper. If you want to set parameters to a PreparedStatement object by yourself, you can use this method. You can use yourResultSetTraverseror the object getting byOrm.getResultSetTraverser(Class);- 型パラメータ:
T-- パラメータ:
statementSupplier-traverser-- 戻り値:
-
executeQuery
<T> List<T> executeQuery(FunctionHandler<Connection,PreparedStatement> statementSupplier, RowMapper<T> rowMapper)
Executes the query with the given PreparedStatement and applies the given RowMapper. If you want to set parameters to a PreparedStatement object by yourself, you can use this method. You can use yourRowMapperor the object getting byOrm.getRowMapper(Class);- 型パラメータ:
T-- パラメータ:
statementSupplier-rowMapper-- 戻り値:
-
executeQuery
<T> T executeQuery(ParameterizedSql sql, ResultSetTraverser<T> traverser)
Executes a query and apply the givenResultSetTraverserto 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
<T> List<T> executeQuery(ParameterizedSql sql, RowMapper<T> mapper)
Executes a query and apply the givenRowMapperto the each row in returned result set.- 型パラメータ:
T-- パラメータ:
sql-mapper-- 戻り値:
-
executeUpdate
int executeUpdate(String sql, Object... parameters)
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
int executeUpdate(ParameterizedSql sql)
- パラメータ:
sql-- 戻り値:
-
-