Top Description Fields Constructors Methods
org.springframework.r2dbc.core

pack-priv final Class ResultFunction

extends Object
implements ConnectionFunction<Flux<Result>>
Class Inheritance
All Implemented Interfaces
org.springframework.r2dbc.core.ConnectionFunction, org.springframework.r2dbc.core.SqlProvider, java.util.function.Function
Imports
java.util.function.BiFunction, .Supplier, io.r2dbc.spi.Connection, .Result, .Statement, reactor.core.publisher.Flux, org.springframework.lang.Nullable, org.springframework.util.Assert, .StringUtils

A ConnectionFunction that produces a Flux of Result and that defers generation of the SQL until the function has been applied. Beforehand, the getSql() method simply returns null. The sql String is also memoized during application, so that subsequent calls to getSql() return the same String without further calls to the Supplier.
Authors
Mark Paluch, Simon Baslé
Since
5.3.26

Field Summary

Modifier and TypeField and Description
pack-priv final ExecuteFunction
pack-priv final StatementFilterFunction
pack-priv String
pack-priv final Supplier<String>
pack-priv final BiFunction<Connection, String, Statement>

Constructor Summary

AccessConstructor and Description
pack-priv
ResultFunction(Supplier<String> sqlSupplier, BiFunction<Connection, String, Statement> statementFunction, StatementFilterFunction filterFunction, ExecuteFunction executeFunction)

Method Summary

Modifier and TypeMethod and Description
public Flux<Result>
apply(Connection
the function argument
connection
)

Implements java.util.function.Function.apply.

Applies this function to the given argument.
public String
getSql()

Implements org.springframework.r2dbc.core.SqlProvider.getSql.

Return the SQL string for this object, i.e. typically the SQL used for creating statements.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executeFunctionback to summary
pack-priv final ExecuteFunction executeFunction
filterFunctionback to summary
pack-priv final StatementFilterFunction filterFunction
resolvedSqlback to summary
pack-priv String resolvedSql
Annotations
@Nullable
sqlSupplierback to summary
pack-priv final Supplier<String> sqlSupplier
statementFunctionback to summary
pack-priv final BiFunction<Connection, String, Statement> statementFunction

Constructor Detail

ResultFunctionback to summary
pack-priv ResultFunction(Supplier<String> sqlSupplier, BiFunction<Connection, String, Statement> statementFunction, StatementFilterFunction filterFunction, ExecuteFunction executeFunction)

Method Detail

applyback to summary
public Flux<Result> apply(Connection connection)

Implements java.util.function.Function.apply.

Doc from java.util.function.Function.apply.

Applies this function to the given argument.

Parameters
connection:Connection

the function argument

Returns:Flux<Result>

the function result

Annotations
@Override
getSqlback to summary
public String getSql()

Implements org.springframework.r2dbc.core.SqlProvider.getSql.

Doc from org.springframework.r2dbc.core.SqlProvider.getSql.

Return the SQL string for this object, i.e. typically the SQL used for creating statements.

Returns:String

the SQL string, or null if not available

Annotations
@Nullable
@Override