クラス 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
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明createParameterSource
(ObjectSE input) 新しいSqlParameterSource
を返します。結果をキャッシュしないSqlParameterSource
を評価する式を作成します。protected void
onInit()
void
setParameterExpressions
(MapSE<StringSE, StringSE> parameterExpressions) オプションで、パラメーター名を明示的な式にマップします。void
setSqlParameterTypes
(MapSE<StringSE, IntegerSE> sqlParametersTypes) パラメーターの SQL 型を指定します。void
setStaticParameters
(MapSE<StringSE, ObjectSE> staticParameters) いくつかの静的パラメーター値を定義します。クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたメソッド
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService, setSimpleEvaluationContext
コンストラクターの詳細
ExpressionEvaluatingSqlParameterSourceFactory
public ExpressionEvaluatingSqlParameterSourceFactory()
メソッドの詳細
setStaticParameters
いくつかの静的パラメーター値を定義します。これらはparameterExpressions
で式として定義されているものよりも優先されるため、クエリのパラメーターは最初にここから入力され、次に式から入力されます。- パラメーター:
staticParameters
- 設定する静的パラメーター
setParameterExpressions
オプションで、パラメーター名を明示的な式にマップします。Spring での名前付きパラメーターのサポートは、特殊文字のない単純なパラメーター名に限定されているため、この機能を使用すると、SQL クエリで単純な名前を指定し、実行時に式に変換できます。式のターゲットはコンテキストに依存します。通常、送信設定ではメッセージであり、受信設定では結果セット行(マップまたは RowMapper が提供されている場合はドメインオブジェクト)です。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
- 設定するパラメーター式
setSqlParameterTypes
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