public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpressionEvaluator implements SqlParameterSourceFactory
SqlParameterSource を作成する SqlParameterSourceFactory の実装。さらに、ユーザーは常に優先される静的パラメーターを指定できます。EXPRESSION_PARSER, logger| コンストラクターと説明 |
|---|
ExpressionEvaluatingSqlParameterSourceFactory() |
| 修飾子と型 | メソッドと説明 |
|---|---|
SqlParameterSource | createParameterSource(ObjectSE input) 新しい SqlParameterSource を返します。 |
SqlParameterSource | createParameterSourceNoCache(ObjectSE input) 結果をキャッシュしない SqlParameterSource を評価する式を作成します。 |
protected void | onInit() |
void | setParameterExpressions(MapSE<StringSE, StringSE> parameterExpressions) オプションで、パラメーター名を明示的な式にマップします。 |
void | setSqlParameterTypes(MapSE<StringSE, IntegerSE> sqlParametersTypes) パラメーターの SQL 型を指定します。 |
void | setStaticParameters(MapSE<StringSE, ObjectSE> staticParameters) いくつかの静的パラメーター値を定義します。 |
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionServicecloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic ExpressionEvaluatingSqlParameterSourceFactory()
public void setStaticParameters(MapSE<StringSE,ObjectSE> staticParameters)
parameterExpressions で式として定義されているものよりも優先されるため、クエリのパラメーターは最初にここから入力され、次に式から入力されます。staticParameters - 設定する静的パラメーター public void setParameterExpressions(MapSE<StringSE,StringSE> parameterExpressions)
static parameters は、変数 #staticParameters を使用する式で参照できます。例:| キー | 値 (式) | SQL の例 |
|---|---|---|
| id | payload.businessKey | select * from items where id=:id |
| 日付 | headers['timestamp'] | select * from items where created>:date |
| キー | #staticParameters['foo'].toUpperCase() | select * from items where name=:key |
parameterExpressions - 設定するパラメーター式 public void setSqlParameterTypes(MapSE<StringSE,IntegerSE> sqlParametersTypes)
TypesSE を使用して、パラメーター型の値を取得します。sqlParametersTypes - 使用するパラメーター型 TypesSEpublic SqlParameterSource createParameterSource(ObjectSE input)
SqlParameterSourceFactorySqlParameterSource を返します。SqlParameterSourceFactory の createParameterSource input - SqlParameterSource に変換される生のメッセージまたはクエリ結果 public SqlParameterSource createParameterSourceNoCache(ObjectSE input)
SqlParameterSource を評価する式を作成します。たとえば、select-sql-parameter-source 属性の <int-jdbc:inbound-channel-adapter/> でソースが複数回使用される場合に役立ちます。input - 評価のルートオブジェクト。protected void onInit()
AbstractExpressionEvaluator の onInit