クラス DataClassRowMapper<T>
java.lang.ObjectSE
org.springframework.jdbc.core.BeanPropertyRowMapper<T>
org.springframework.jdbc.core.DataClassRowMapper<T>
- 型パラメーター:
T
- 結果の型
- 実装されたすべてのインターフェース:
RowMapper<T>
行を指定されたマップされたターゲットクラスの新しいインスタンスに変換する
RowMapper
実装。マップされたターゲットクラスはトップレベルクラスである必要があり、列名に対応する名前付きパラメーターを持つデータクラスコンストラクター、または従来の Bean プロパティ setter(または両方の組み合わせ)を公開できます。 このクラスは BeanPropertyRowMapper
を継承するため、マップされたターゲットクラスの一般的な選択肢として機能し、マップされたクラスの setter メソッドに対してコンストラクタースタイルに柔軟に適応できることに注意してください。
- 導入:
- 5.3
- 作成者:
- Juergen Hoeller
フィールドサマリー
クラス org.springframework.jdbc.core.BeanPropertyRowMapper から継承されたフィールド
logger
コンストラクターのサマリー
コンストラクター説明Bean スタイルの構成用に新しいDataClassRowMapper
を作成します。DataClassRowMapper
(ClassSE<T> mappedClass) 新しいDataClassRowMapper
を作成します。メソッドのサマリー
修飾子と型メソッド説明protected T
現在の行のマップされたクラスのインスタンスを作成します。protected void
initialize
(ClassSE<T> mappedClass) 指定されたクラスのマッピングメタデータを初期化します。static <T> DataClassRowMapper<T>
newInstance
(ClassSE<T> mappedClass) 新しいDataClassRowMapper
を作成する静的ファクトリメソッド。static <T> DataClassRowMapper<T>
newInstance
(ClassSE<T> mappedClass, ConversionService conversionService) 新しいDataClassRowMapper
を作成する静的ファクトリメソッド。クラス org.springframework.jdbc.core.BeanPropertyRowMapper から継承されたメソッド
getColumnValue, getColumnValue, getConversionService, getMappedClass, initBeanWrapper, isCheckFullyPopulated, isPrimitivesDefaultedForNullValue, lowerCaseName, mapRow, setCheckFullyPopulated, setConversionService, setMappedClass, setPrimitivesDefaultedForNullValue, suppressProperty, underscoreName
コンストラクターの詳細
DataClassRowMapper
public DataClassRowMapper()Bean スタイルの構成用に新しいDataClassRowMapper
を作成します。DataClassRowMapper
新しいDataClassRowMapper
を作成します。- パラメーター:
mappedClass
- 各行がマップされるクラス
メソッドの詳細
initialize
クラスからコピーされた説明:BeanPropertyRowMapper
指定されたクラスのマッピングメタデータを初期化します。- オーバーライド:
- クラス
BeanPropertyRowMapper<T>
のinitialize
- パラメーター:
mappedClass
- マッピングされたクラス
constructMappedInstance
クラスからコピーされた説明:BeanPropertyRowMapper
現在の行のマップされたクラスのインスタンスを作成します。- オーバーライド:
- クラス
BeanPropertyRowMapper<T>
のconstructMappedInstance
- パラメーター:
rs
- ResultSet をマップする (現在の行に対して事前に初期化済み)tc
- この RowMapper の変換サービスを備えた TypeConverter- 戻り値:
- マップされたクラスの対応するインスタンス
- 例外:
SQLExceptionSE
- SQLException が発生した場合
newInstance
新しいDataClassRowMapper
を作成する静的ファクトリメソッド。- パラメーター:
mappedClass
- 各行がマップされるクラス- 関連事項:
newInstance
public static <T> DataClassRowMapper<T> newInstance(ClassSE<T> mappedClass, @Nullable ConversionService conversionService) 新しいDataClassRowMapper
を作成する静的ファクトリメソッド。- パラメーター:
mappedClass
- 各行がマップされるクラスconversionService
- JDBC 値を Bean プロパティにバインドする場合はConversionService
、ない場合はnull
- 関連事項: