public abstract class NamedParameterUtils extends ObjectSE
Spring の JDBC フレームワーク内での内部使用のみを目的としています。
コンストラクターと説明 |
---|
NamedParameterUtils() |
修飾子と型 | メソッドと説明 |
---|---|
static ListSE<SqlParameter> | buildSqlParameterList(ParsedSql parsedSql, SqlParameterSource paramSource) パラメーター宣言を SqlParameterSource から対応する SqlParameters のリストに変換します。 |
static int[] | buildSqlTypeArray(ParsedSql parsedSql, SqlParameterSource paramSource) パラメーター型を SqlParameterSource から対応する int 配列に変換します。 |
static ObjectSE[] | buildValueArray(ParsedSql parsedSql, SqlParameterSource paramSource, ListSE<SqlParameter> declaredParams) 名前付きパラメーター値のマップを対応する配列に変換します。 |
static ObjectSE[] | buildValueArray(StringSE sql, MapSE<StringSE,?> paramMap) 名前付きパラメーター値のマップを対応する配列に変換します。 |
static ParsedSql | parseSqlStatement(StringSE sql) SQL ステートメントを解析し、プレースホルダーまたは名前付きパラメーターを見つけます。 |
static StringSE | parseSqlStatementIntoString(StringSE sql) SQL ステートメントを解析し、プレースホルダーまたは名前付きパラメーターを見つけます。 |
static StringSE | substituteNamedParameters(ParsedSql parsedSql, SqlParameterSource paramSource) SQL ステートメントを解析し、プレースホルダーまたは名前付きパラメーターを見つけます。 |
static StringSE | substituteNamedParameters(StringSE sql, SqlParameterSource paramSource) SQL ステートメントを解析し、プレースホルダーまたは名前付きパラメーターを見つけます。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static ParsedSql parseSqlStatement(StringSE sql)
sql
- SQL ステートメント public static StringSE substituteNamedParameters(ParsedSql parsedSql, @Nullable SqlParameterSource paramSource)
select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))
渡されるパラメーター値は、選択リストに使用されるプレースホルダーの数を決定するために使用されます。選択リストは 100 個以下の要素に制限する必要があります。多数の要素がデータベースでサポートされることは保証されておらず、厳密にベンダーに依存しています。
parsedSql
- SQL 文の解析された表現 paramSource
- 名前付きパラメーターのソース parseSqlStatement(java.lang.String)
public static ObjectSE[] buildValueArray(ParsedSql parsedSql, SqlParameterSource paramSource, @Nullable ListSE<SqlParameter> declaredParams)
parsedSql
- 解析された SQL ステートメント paramSource
- 名前付きパラメーターのソース declaredParams
- 宣言された SqlParameter オブジェクトのリスト(null
の場合がある)指定した場合、パラメーターメタデータは SqlParameterValue オブジェクトの形式で値の配列に組み込まれます。public static int[] buildSqlTypeArray(ParsedSql parsedSql, SqlParameterSource paramSource)
parsedSql
- 解析された SQL ステートメント paramSource
- 名前付きパラメーターのソース public static ListSE<SqlParameter> buildSqlParameterList(ParsedSql parsedSql, SqlParameterSource paramSource)
parsedSql
- 解析された SQL ステートメント paramSource
- 名前付きパラメーターのソース public static StringSE parseSqlStatementIntoString(StringSE sql)
これは substituteNamedParameters(ParsedSql, SqlParameterSource)
と組み合わせた parseSqlStatement(String)
のショートカットバージョンです。
sql
- SQL ステートメント public static StringSE substituteNamedParameters(StringSE sql, SqlParameterSource paramSource)
これは substituteNamedParameters(ParsedSql, SqlParameterSource)
のショートカットバージョンです。
sql
- SQL ステートメント paramSource
- 名前付きパラメーターのソース public static ObjectSE[] buildValueArray(StringSE sql, MapSE<StringSE,?> paramMap)
これは buildValueArray(ParsedSql, SqlParameterSource, java.util.List)
のショートカットバージョンです。
sql
- SQL ステートメント paramMap
- パラメーターのマップ