クラス 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
public class R2dbcMessageSource extends AbstractMessageSource<org.reactivestreams.Publisher<?>>
クエリの実行の結果であるペイロードを含む
Message を返す MessageSource のインスタンス。expectSingleResult が false(デフォルト)の場合、R2DBC クエリが実行され、Flux が返されます。返された Flux は、AbstractMessageSource.receive() メソッドによって返される Message のペイロードとして使用されます。expectSingleResult が true の場合、クエリが実行され、クエリから返された単一のオブジェクトの Mono が返されます。
- 導入:
- 5.4
- 作成者:
- Rohan Mukesh, Artem Bilan
ネストされたクラスの要約
ネストされたクラス 修飾子と型 クラス 説明 classR2dbcMessageSource.SelectCreatorこのクラスのインスタンスは、クエリ式のルートオブジェクトとして使用され、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 ObjectSEdoReceive()結果をメッセージペイロードとして返すクエリを実行します。StringSEgetComponentType()protected voidonInit()voidsetBindFunction(BiFunctionSE<DatabaseClient.GenericExecuteSpec,?,DatabaseClient.GenericExecuteSpec> bindFunction)パラメーターを更新クエリにバインドするために使用されるBiFunctionSE を設定します。voidsetExpectSingleResult(boolean expectSingleResult)R2dbcEntityOperationsで呼び出す find * メソッドを管理するためのフラグ。voidsetPayloadType(ClassSE<?> payloadType)EntityRowMapperに使用する entityClass の型を設定します。voidsetUpdateSql(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
コンストラクターの詳細
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)パラメーターを更新クエリにバインドするために使用されるBiFunctionSE を設定します。- パラメーター:
bindFunction- 使用するBiFunctionSE。
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 - 戻り値:
- 返された値。