クラス ExpressionEvaluatingSqlParameterSourceFactory
java.lang.ObjectSE
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory
- 実装されているすべてのインターフェース:
Aware、BeanFactoryAware、InitializingBean、SqlParameterSourceFactory
public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpressionEvaluator implements SqlParameterSourceFactory
Spring EL 式を評価する
SqlParameterSource を作成する SqlParameterSourceFactory の実装。さらに、ユーザーは常に優先される静的パラメーターを指定できます。- 導入:
- 2.0
- 作成者:
- Dave Syer, Oleg Zhurakousky, Gary Russell, Artem Bilan, Meherzad Lahewala
フィールドのサマリー
クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたフィールド
EXPRESSION_PARSER, loggerコンストラクターの概要
コンストラクター コンストラクター 説明 ExpressionEvaluatingSqlParameterSourceFactory()メソッドのサマリー
修飾子と型 メソッド 説明 SqlParameterSourcecreateParameterSource(ObjectSE input)新しいSqlParameterSourceを返します。SqlParameterSourcecreateParameterSourceNoCache(ObjectSE input)結果をキャッシュしないSqlParameterSourceを評価する式を作成します。protected voidonInit()voidsetParameterExpressions(MapSE<StringSE,StringSE> parameterExpressions)オプションで、パラメーター名を明示的な式にマップします。voidsetSqlParameterTypes(MapSE<StringSE,IntegerSE> sqlParametersTypes)パラメーターの SQL 型を指定します。voidsetStaticParameters(MapSE<StringSE,ObjectSE> staticParameters)いくつかの静的パラメーター値を定義します。クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたメソッド
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService
コンストラクターの詳細
ExpressionEvaluatingSqlParameterSourceFactory
public ExpressionEvaluatingSqlParameterSourceFactory()
メソッドの詳細
setStaticParameters
いくつかの静的パラメーター値を定義します。これらはparameterExpressionsで式として定義されているものよりも優先されるため、クエリのパラメーターは最初にここから入力され、次に式から入力されます。- パラメーター:
staticParameters- 設定する静的パラメーター
setParameterExpressions
オプションで、パラメーター名を明示的な式にマップします。Spring での名前付きパラメーターのサポートは、特殊文字のない単純なパラメーター名に限定されているため、この機能を使用すると、SQL クエリで単純な名前を指定し、実行時に式に変換できます。式のターゲットはコンテキストに依存します。通常、送信設定ではメッセージであり、受信設定では結果セット行(マップまたは RowMapper が提供されている場合はドメインオブジェクト)です。static parametersは、変数#staticParametersを使用する式で参照できます。例:パラメーター式のサンプル キー 値 (式) SQL の例 id payload.businessKeyselect * from items where id=:id日付 headers['timestamp']select * from items where created>:dateキー #staticParameters['foo'].toUpperCase()select * from items where name=:key- パラメーター:
parameterExpressions- 設定するパラメーター式
setSqlParameterTypes
パラメーターの SQL 型を指定します。オプション。TypesSE を使用して、パラメーター型の値を取得します。- パラメーター:
sqlParametersTypes- 使用するパラメーター型- 導入:
- 5.0
- 関連事項:
TypesSE
createParameterSource
インターフェースからコピーされた説明:SqlParameterSourceFactory新しいSqlParameterSourceを返します。- 次で指定:
- インターフェース
SqlParameterSourceFactoryのcreateParameterSource - パラメーター:
input- SqlParameterSource に変換される生のメッセージまたはクエリ結果- 戻り値:
- パラメーターソース。
createParameterSourceNoCache
結果をキャッシュしないSqlParameterSourceを評価する式を作成します。たとえば、select-sql-parameter-source属性の<int-jdbc:inbound-channel-adapter/>でソースが複数回使用される場合に役立ちます。- パラメーター:
input- 評価のルートオブジェクト。- 戻り値:
- パラメーターソース。
onInit
protected void onInit()- オーバーライド:
- クラス
AbstractExpressionEvaluatorのonInit