java.lang.ObjectSE
org.springframework.jdbc.object.RdbmsOperation
org.springframework.jdbc.object.SqlOperation
org.springframework.jdbc.object.SqlQuery<T>
org.springframework.jdbc.object.MappingSqlQueryWithParameters<T>
org.springframework.jdbc.object.MappingSqlQuery<T>
- 型パラメーター:
T- 結果の型
- 実装されているすべてのインターフェース:
InitializingBean
- 既知の直属サブクラス
SqlFunction
public abstract class MappingSqlQuery<T extends @Nullable ObjectSE>
extends MappingSqlQueryWithParameters<T>
再利用可能なクエリでは、具象サブクラスが抽象 mapRow(ResultSet, int) メソッドを実装して、JDBC ResultSet の各行をオブジェクトに変換する必要があります。
パラメーターとコンテキストを削除することにより、MappingSqlQueryWithParameters API を簡素化します。ほとんどのサブクラスはパラメーターを気にしません。コンテキスト情報を使用しない場合は、MappingSqlQueryWithParameters の代わりにこれをサブクラス化します。
- 作成者:
- Rod Johnson, Thomas Risberg, Jean-Pierre Pawlak
- 関連事項:
ネストされたクラスの要約
クラス MappingSqlQueryWithParameters から継承されたネストクラス / インターフェース
MappingSqlQueryWithParameters.RowMapperImplフィールドのサマリー
クラス RdbmsOperation から継承されたフィールド
loggerコンストラクターの概要
コンストラクターコンストラクター説明JavaBean として使用できるコンストラクター。MappingSqlQuery(DataSourceSE ds, StringSE sql) DataSource と SQL 文字列を持つ便利なコンストラクター。メソッドのサマリー
修飾子と型メソッド説明protected abstract TmapRow(ResultSetSE rs, int rowNum) サブクラスはこのメソッドを実装して、ResultSet の各行を結果型のオブジェクトに変換する必要があります。protected final TmapRow(ResultSetSE rs, int rowNum, @Nullable ObjectSE @Nullable [] parameters, @Nullable MapSE<?, ?> context) このメソッドは、パラメーターを無視して、より単純な mapRow テンプレートメソッドを呼び出すために実装されています。クラス MappingSqlQueryWithParameters から継承されたメソッド
newRowMapperクラス SqlQuery から継承されたメソッド
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, stream, stream, stream, stream, streamByNamedParam, streamByNamedParamクラス SqlOperation から継承されたメソッド
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternalクラス RdbmsOperation から継承されたメソッド
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, resolveSql, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
コンストラクターの詳細
MappingSqlQuery
public MappingSqlQuery()JavaBean として使用できるコンストラクター。MappingSqlQuery
DataSource と SQL 文字列を持つ便利なコンストラクター。- パラメーター:
ds- 接続を取得するために使用する DataSourcesql- 実行する SQL
メソッドの詳細
mapRow
protected final T mapRow(ResultSetSE rs, int rowNum, @Nullable ObjectSE @Nullable [] parameters, @Nullable MapSE<?, ?> context) throws SQLExceptionSEこのメソッドは、パラメーターを無視して、より単純な mapRow テンプレートメソッドを呼び出すために実装されています。- 次で指定:
- クラス
MappingSqlQueryWithParameters<T extends @Nullable ObjectSE>のmapRow - パラメーター:
rs- 取り組んでいる ResultSetrowNum- 行番号(0 から)parameters- クエリに(execute() メソッドに渡されます)。サブクラスがこれらに関心を持つことはほとんどありません。パラメーターがない場合は、nullになります。context- execute() メソッドに渡されます。コンテキスト情報が必要ない場合は、nullにすることができます。- 戻り値:
- 結果型のオブジェクト
- 例外:
SQLExceptionSE- データの抽出中にエラーが発生した場合。サブクラスは SQLException を単純にキャッチできず、クリーンアップはフレームワークに依存しています。- 関連事項:
mapRow
サブクラスはこのメソッドを実装して、ResultSet の各行を結果型のオブジェクトに変換する必要があります。このクラスのサブクラスは、MappingSqlQueryWithParameters の直接のサブクラスとは異なり、クエリオブジェクトの実行メソッドへのパラメーターに関係する必要はありません。
- パラメーター:
rs- 取り組んでいる ResultSetrowNum- 行番号(0 から)- 戻り値:
- 結果型のオブジェクト
- 例外:
SQLExceptionSE- データの抽出中にエラーが発生した場合。サブクラスは SQLException を単純にキャッチできず、クリーンアップはフレームワークに依存しています。