|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.apache.commons.dbutils.BasicRowProcessor
RowProcessor インターフェースの基本実装です。
このクラスはスレッドセーフなSingletonです。
RowProcessor interface.
This class is a thread-safe Singleton.
RowProcessor | コンストラクタの概要 | |
protected |
BasicRowProcessor()
BasicRowProcessorのサブクラスのみを対象としたprotectedスコープのコンストラクタ。 |
| メソッドの概要 | |
static BasicRowProcessor |
instance()
このクラスのSingletonインスタンスを返します。 |
Object[] |
toArray(ResultSet rs)
ResultSet の行を Object[] へ変換します。
|
Object |
toBean(ResultSet rs,
Class type)
ResultSet の行をJavaBeanへ変換します。
|
List |
toBeanList(ResultSet rs,
Class type)
ResultSet をJavaBeanの List へ変換します。
|
Map |
toMap(ResultSet rs)
ResultSet の行を Map へ変換します。
|
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
protected BasicRowProcessor()
| メソッドの詳細 |
public static BasicRowProcessor instance()
public Object[] toArray(ResultSet rs)
throws SQLException
ResultSet の行を Object[] へ変換します。
この実装は、 ResultSet から返されたカラム値を配列へ同順にコピーします。
カラム値がSQL NULLであれば、配列の要素には null がセットされます。
ResultSet row into an Object[].
This implementation copies column values into the array in the same
order they're returned from the ResultSet. Array elements
will be set to null if the column was SQL NULL.
RowProcessor 内の toArraySQLExceptionRowProcessor.toArray(java.sql.ResultSet)
public Object toBean(ResultSet rs,
Class type)
throws SQLException
ResultSet の行をJavaBeanへ変換します。
この実装では、カラム名とBeanプロパティ名が一致するかどうか判定するために、 リフレクションおよび
BeanInfoのクラスを使用しています。
プロパティはいくつかの要因に基づいたカラムと一致します。
ResultSet row into a JavaBean. This
implementation uses reflection and BeanInfo classes to
match column names to bean property names. Properties are matched to
columns based on several factors:
ResultSet よりSQL NULLが返されると、 プリミティブ型の
Bean プロパティは、その型のデフォルト値がセットされます。
数値型のフィールドには0がセットされ、boolean 型のフィールドには false がセットされます。
SQL NULLが返されると、オブジェクト型のプロパティには null がセットされます。
これは、 ResultSet の get* メソッドと同一の振る舞いです。
ResultSet. Numeric fields are set to 0
and booleans are set to false. Object bean properties are set to
null when SQL NULL is returned. This is the same behavior
as the ResultSet get* methods.
RowProcessor 内の toBeanSQLExceptionRowProcessor.toBean(java.sql.ResultSet, java.lang.Class)
public List toBeanList(ResultSet rs,
Class type)
throws SQLException
ResultSet をJavaBeanの List へ変換します。
この実装では、カラム名とBeanプロパティ名が一致するかどうか判定するために、 リフレクションおよび
BeanInfo のクラスを使用しています。
プロパティはいくつかの要因に基づいたカラムと一致します。
ResultSet into a List of JavaBeans.
This implementation uses reflection and BeanInfo classes to
match column names to bean property names. Properties are matched to
columns based on several factors:
ResultSet よりSQL NULLが返されると、 プリミティブ型の
Bean プロパティは、その型のデフォルト値がセットされます。
数値型のフィールドには0がセットされ、boolean 型のフィールドには false がセットされます。
SQL NULLが返されると、オブジェクト型のプロパティには null がセットされます。
これは、ResultSet の get* メソッドと同一の振る舞いです。
ResultSet. Numeric fields are set to 0
and booleans are set to false. Object bean properties are set to
null when SQL NULL is returned. This is the same behavior
as the ResultSet get* methods.
RowProcessor 内の toBeanListResultSet によって返された順序にしたがっている指定された型の Bean の List。
List of beans with the given type in the order
they were returned by the ResultSet.SQLExceptionRowProcessor.toBeanList(java.sql.ResultSet, java.lang.Class)
public Map toMap(ResultSet rs)
throws SQLException
ResultSet の行を Map へ変換します。
この実装では、大小文字を区別しないカラム名をキーとしたMapを返します。
例えば、map.get("COL") の呼び出しと
map.get("col") の呼び出しでは、 同一の値が返されるようになります。
ResultSet row into a Map. This
implementation returns a Map with case insensitive column
names as keys. Calls to map.get("COL") and
map.get("col") return the same value.
RowProcessor 内の toMapSQLExceptionRowProcessor.toMap(java.sql.ResultSet)
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||