|
|||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectwoolpack.sql.fn.SqlFnUtils
public class SqlFnUtils
RDB にアクセスする部品のユーティリティです。
フィールドの概要 | |
---|---|
static Fn<Statement,Integer,SQLException> |
GET_COUNT
Statement.getUpdateCount() で更新された数を返す関数です。 |
static Fn<ResultSet,Object,SQLException> |
GET_SINGLE
現在の行の最初の列の値を返す関数です。 |
メソッドの概要 | ||
---|---|---|
static
|
getBeanResult(Fn<? super ResultSet,? extends R,? extends Exception> beanFactory)
現在の行をBeanにコピーして返す関数を生成します。 |
|
static
|
getBeanResult(Fn<? super ResultSet,? extends R,? extends Exception> beanFactory,
Fn<String,EL,? extends Exception> elFactory)
現在の行をBeanにコピーして返す関数を生成します。 |
|
static
|
getList(Fn<? super ResultSet,? extends R,? extends Exception> fn,
Fn<? super SQLException,?,? extends Exception> errorFn)
Statement.getResultSet() のResultSet.next() でカーソルを移動しながら
委譲先にレコード情報の生成を委譲して、
その結果をList に格納して返す関数を生成します。 |
|
static
|
getList(Fn<? super ResultSet,? extends R,? extends Exception> rowFn,
int max,
Fn<? super SQLException,?,? extends Exception> errorFn)
Statement.getResultSet() のResultSet.next() でカーソルを移動しながら
委譲先にレコード情報の生成を委譲して、
その結果をList に格納して返す関数を生成します。 |
|
static
|
getOne(Fn<? super ResultSet,? extends R,? extends Exception> rowFn,
Fn<? super SQLException,?,? extends Exception> errorFn)
検索結果を一行だけ取得して返す関数を生成します。 |
|
static
|
inputBean(DataSource dataSource,
Fn<? super C,? extends PreparedStatementInfo,? extends Exception> queryFactory,
Fn<? super PreparedStatement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn)
委譲先から PreparedStatementInfo を取得し、引数をPreparedStatement に設定して
PreparedStatement.execute() を実行し、返却値の生成を委譲する関数を生成します。 |
|
static
|
inputBean(DataSource dataSource,
Fn<? super C,? extends PreparedStatementInfo,? extends Exception> queryFactory,
Fn<? super PreparedStatement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn,
Fn<String,? extends GettingEL,? extends Exception> elFactory)
委譲先から PreparedStatementInfo を取得し、引数をPreparedStatement に設定して
PreparedStatement.execute() を実行し、返却値の生成を委譲する関数を生成します。 |
|
static
|
inputBean(DataSource dataSource,
PreparedStatementInfo info,
Fn<? super PreparedStatement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn)
委譲先から PreparedStatementInfo を取得し、引数をPreparedStatement に設定して
PreparedStatement.execute() を実行し、返却値の生成を委譲する関数を生成します。 |
|
static
|
inputSingle(DataSource dataSource,
Fn<? super C,? extends String,? extends Exception> queryFactory,
Fn<? super PreparedStatement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn)
委譲先からクエリを取得し、 引数を PreparedStatement に設定して
PreparedStatement.execute() を実行し、
返却値の生成を委譲する関数を生成します。 |
|
static
|
inputSingle(DataSource dataSource,
String query,
Fn<? super PreparedStatement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn)
委譲先からクエリを取得し、 引数を PreparedStatement に設定して
PreparedStatement.execute() を実行し、
返却値の生成を委譲する関数を生成します。 |
|
static
|
inputStatement(DataSource dataSource,
Fn<? super C,? extends String,? extends Exception> queryFactory,
Fn<? super Statement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn)
委譲先からクエリを取得して Statement.execute(String) を実行し、
返却値の生成を委譲する関数を生成します。 |
|
static
|
inputStatement(DataSource dataSource,
String query,
Fn<? super Statement,? extends R,? extends Exception> converter,
Fn<? super SQLException,?,? extends Exception> errorFn)
委譲先からクエリを取得して Statement.execute(String) を実行し、
返却値の生成を委譲する関数を生成します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public static final Fn<Statement,Integer,SQLException> GET_COUNT
Statement.getUpdateCount()
で更新された数を返す関数です。
public static final Fn<ResultSet,Object,SQLException> GET_SINGLE
メソッドの詳細 |
---|
public static <R> Fn<ResultSet,R,Exception> getBeanResult(Fn<? super ResultSet,? extends R,? extends Exception> beanFactory)
EL
を使用するため、Map
の入力にも対応しています。
R
- beanFactory
- Beanのファクトリ。
getBeanResult(Fn, Fn)
public static <R> Fn<ResultSet,R,Exception> getBeanResult(Fn<? super ResultSet,? extends R,? extends Exception> beanFactory, Fn<String,EL,? extends Exception> elFactory)
EL
を使用するため、Map
の入力にも対応しています。
R
- beanFactory
- Beanのファクトリ。elFactory
- プロパティ名からEL
を生成するファクトリ。
public static <R> Fn<Statement,List<R>,Exception> getList(Fn<? super ResultSet,? extends R,? extends Exception> rowFn, int max, Fn<? super SQLException,?,? extends Exception> errorFn)
Statement.getResultSet()
のResultSet.next()
でカーソルを移動しながら
委譲先にレコード情報の生成を委譲して、
その結果をList
に格納して返す関数を生成します。
Fn
のComposite。
R
- rowFn
- 委譲先。max
- 最大この数までResultSet.next()
を呼び出す閾値。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
public static <R> Fn<Statement,List<R>,Exception> getList(Fn<? super ResultSet,? extends R,? extends Exception> fn, Fn<? super SQLException,?,? extends Exception> errorFn)
Statement.getResultSet()
のResultSet.next()
でカーソルを移動しながら
委譲先にレコード情報の生成を委譲して、
その結果をList
に格納して返す関数を生成します。
最大Integer.MAX_VALUE
回ResultSet.next()
を呼び出します。
R
- fn
- 委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
getList(Fn, int, Fn)
public static <C,R> Fn<C,R,Exception> inputBean(DataSource dataSource, Fn<? super C,? extends PreparedStatementInfo,? extends Exception> queryFactory, Fn<? super PreparedStatement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn, Fn<String,? extends GettingEL,? extends Exception> elFactory)
PreparedStatementInfo
を取得し、引数をPreparedStatement
に設定して
PreparedStatement.execute()
を実行し、返却値の生成を委譲する関数を生成します。
値の設定にGettingEL
を使用するため、Map
の入力にも対応しています。
Fn
のComposite。
C
- R
- dataSource
- データソース。queryFactory
- クエリ情報生成の委譲先。converter
- 変換の委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。elFactory
- 引数から値を取得するためのGettingEL
のファクトリ。
public static <C,R> Fn<C,R,Exception> inputBean(DataSource dataSource, Fn<? super C,? extends PreparedStatementInfo,? extends Exception> queryFactory, Fn<? super PreparedStatement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn)
PreparedStatementInfo
を取得し、引数をPreparedStatement
に設定して
PreparedStatement.execute()
を実行し、返却値の生成を委譲する関数を生成します。
値の設定にGettingEL
を使用するため、Map
の入力にも対応しています。
Fn
のComposite。
C
- R
- dataSource
- データソース。queryFactory
- クエリ情報生成の委譲先。converter
- 変換の委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
public static <C,R> Fn<C,R,Exception> inputBean(DataSource dataSource, PreparedStatementInfo info, Fn<? super PreparedStatement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn)
PreparedStatementInfo
を取得し、引数をPreparedStatement
に設定して
PreparedStatement.execute()
を実行し、返却値の生成を委譲する関数を生成します。
値の設定にGettingEL
を使用するため、Map
の入力にも対応しています。
C
- R
- dataSource
- データソース。info
- クエリ情報。converter
- 変換の委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
inputBean(DataSource, Fn, Fn, Fn)
public static <R> Fn<Statement,R,Exception> getOne(Fn<? super ResultSet,? extends R,? extends Exception> rowFn, Fn<? super SQLException,?,? extends Exception> errorFn)
Fn
のComposite。
R
- rowFn
- 一行を返却値に変換する委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
public static <C,R> Fn<C,R,Exception> inputSingle(DataSource dataSource, Fn<? super C,? extends String,? extends Exception> queryFactory, Fn<? super PreparedStatement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn)
PreparedStatement
に設定して
PreparedStatement.execute()
を実行し、
返却値の生成を委譲する関数を生成します。
Fn
のComposite。
C
- R
- dataSource
- データソース。queryFactory
- クエリ生成の委譲先。converter
- 変換の委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
public static <C,R> Fn<C,R,Exception> inputSingle(DataSource dataSource, String query, Fn<? super PreparedStatement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn)
PreparedStatement
に設定して
PreparedStatement.execute()
を実行し、
返却値の生成を委譲する関数を生成します。
C
- R
- dataSource
- データソース。query
- クエリ。converter
- 変換の委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
inputSingle(DataSource, Fn, Fn, Fn)
public static <C,R> Fn<C,R,Exception> inputStatement(DataSource dataSource, Fn<? super C,? extends String,? extends Exception> queryFactory, Fn<? super Statement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn)
Statement.execute(String)
を実行し、
返却値の生成を委譲する関数を生成します。
Fn
のComposite。
C
- R
- dataSource
- データソース。queryFactory
- クエリ生成の委譲先。converter
- 変換の委譲先。errorFn
- SQLException
が発生した場合の委譲先。1回のFn.exec(Object)
呼び出しで複数回委譲する可能性があります。
public static <C,R> Fn<C,R,Exception> inputStatement(DataSource dataSource, String query, Fn<? super Statement,? extends R,? extends Exception> converter, Fn<? super SQLException,?,? extends Exception> errorFn)
Statement.execute(String)
を実行し、
返却値の生成を委譲する関数を生成します。
C
- R
- dataSource
- データソース。query
- クエリ。converter
- 変換の委譲先。
inputStatement(DataSource, Fn, Fn, Fn)
|
|||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |