クラス R2dbcMessageSource
java.lang.ObjectSE
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<org.reactivestreams.Publisher<?>>
org.springframework.integration.r2dbc.inbound.R2dbcMessageSource
- 実装されたすべてのインターフェース:
Aware
、BeanFactoryAware
、BeanNameAware
、DisposableBean
、InitializingBean
、MessageSource<org.reactivestreams.Publisher<?>>
、IntegrationPattern
、NamedComponent
、IntegrationInboundManagement
、IntegrationManagement
クエリの実行の結果であるペイロードを含む
Message
を返す MessageSource
のインスタンス。expectSingleResult
が false(デフォルト)の場合、R2DBC クエリが実行され、Flux
が返されます。返された Flux
は、AbstractMessageSource.receive()
メソッドによって返される Message
のペイロードとして使用されます。expectSingleResult
が true の場合、クエリが実行され、クエリから返された単一のオブジェクトの Mono
が返されます。
- 導入:
- 5.4
- 作成者:
- Rohan Mukesh, Artem Bilan
ネストされたクラスのサマリー
ネストされたクラス修飾子と型クラス説明class
このクラスのインスタンスは、クエリ式のルートオブジェクトとして使用され、StatementMapper.createSelect(java.lang.String)
流れるような API へのアクセスを制限します。インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドサマリー
クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
コンストラクターのサマリー
コンストラクターコンストラクター説明R2dbcMessageSource
(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations, StringSE query) 提供されたR2dbcEntityOperations
および SpEL 式を使用してインスタンスを作成します。これは、リレーショナルの「クエリ」文字列に解決されます。R2dbcMessageSource
(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations, Expression queryExpression) 提供されたR2dbcEntityOperations
および SpEL 式を使用してインスタンスを作成します。これは、クエリ文字列またはStatementMapper.SelectSpec
インスタンスに解決されます。メソッドのサマリー
修飾子と型メソッド説明protected ObjectSE
結果をメッセージペイロードとして返すクエリを実行します。protected void
onInit()
void
setBindFunction
(BiFunctionSE<DatabaseClient.GenericExecuteSpec, ?, DatabaseClient.GenericExecuteSpec> bindFunction) パラメーターを更新クエリにバインドするために使用されるBiFunction
SE を設定します。void
setExpectSingleResult
(boolean expectSingleResult) R2dbcEntityOperations
で呼び出す find * メソッドを管理するためのフラグ。void
setPayloadType
(ClassSE<?> payloadType) EntityRowMapper
に使用される entityClass の型を設定します。void
setUpdateSql
(StringSE updateSql) DatabaseClient.sql(String)
メソッドに渡される更新クエリを設定します。クラス org.springframework.integration.endpoint.AbstractMessageSource から継承されたメソッド
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
クラス org.springframework.integration.util.AbstractExpressionEvaluator から継承されたメソッド
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAs, isObserved, registerObservationRegistry
インターフェース org.springframework.integration.core.MessageSource から継承されたメソッド
getIntegrationPatternType
コンストラクターの詳細
R2dbcMessageSource
public R2dbcMessageSource(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations, StringSE query) 提供されたR2dbcEntityOperations
および SpEL 式を使用してインスタンスを作成します。これは、リレーショナルの「クエリ」文字列に解決されます。R2dbcEntityOperations
が完全に初期化され、使用できる状態になっていることを前提としています。'query' は、AbstractMessageSource.receive()
メソッドを呼び出すたびに評価されます。- パラメーター:
r2dbcEntityOperations
- データベース呼び出しを実行するためのリアクティブデータベースクライアント。query
- クエリ文字列。
R2dbcMessageSource
public R2dbcMessageSource(org.springframework.data.r2dbc.core.R2dbcEntityOperations r2dbcEntityOperations, Expression queryExpression) 提供されたR2dbcEntityOperations
および SpEL 式を使用してインスタンスを作成します。これは、クエリ文字列またはStatementMapper.SelectSpec
インスタンスに解決されます。R2dbcEntityOperations
が完全に初期化され、使用できる状態になっていることを前提としています。'queryExpression' は、AbstractMessageSource.receive()
メソッドを呼び出すたびに評価されます。- パラメーター:
r2dbcEntityOperations
- データベース呼び出しを実行するためのリアクティブ。queryExpression
- クエリ式。評価コンテキストのルートオブジェクトは、StatementMapper.createSelect(java.lang.String)
流れるような API の委譲用のR2dbcMessageSource.SelectCreator
です。
メソッドの詳細
setPayloadType
EntityRowMapper
に使用される entityClass の型を設定します。- パラメーター:
payloadType
- 使用するクラス。
setUpdateSql
DatabaseClient.sql(String)
メソッドに渡される更新クエリを設定します。- パラメーター:
updateSql
- 更新クエリ文字列。
setBindFunction
public void setBindFunction(BiFunctionSE<DatabaseClient.GenericExecuteSpec, ?, DatabaseClient.GenericExecuteSpec> bindFunction) パラメーターを更新クエリにバインドするために使用されるBiFunction
SE を設定します。- パラメーター:
bindFunction
- 使用するBiFunction
SE。
setExpectSingleResult
public void setExpectSingleResult(boolean expectSingleResult) R2dbcEntityOperations
で呼び出す find * メソッドを管理するためのフラグ。デフォルトは "false" です。これは、AbstractMessageSource.receive()
メソッドがDatabaseClient.sql(String)
メソッドを使用し、すべてをフェッチすることを意味します。'true' に設定すると、AbstractMessageSource.receive()
はDatabaseClient.sql(String)
を使用して 1 つをフェッチし、返されるMessage
のペイロードは、リストではなくpayloadType
で識別される型の返されるターゲットオブジェクトになります。- パラメーター:
expectSingleResult
- 単一の結果が期待される場合は true。
getComponentType
onInit
protected void onInit()- オーバーライド:
- クラス
AbstractExpressionEvaluator
のonInit
doReceive
結果をメッセージペイロードとして返すクエリを実行します。ペイロードは、payloadType
で識別される型のオブジェクトのFlux
またはMono
にするか、expectSingleResult
属性の値に基づいてpayloadType
で識別される型の単一要素にすることができます。expectSingleResult
属性の値はデフォルトで 'false' になり、その結果、型Flux
のペイロードを持つMessage
になります。- 次で指定:
- クラス
AbstractMessageSource<org.reactivestreams.Publisher<?>>
のdoReceive
- 戻り値:
- 返された値。