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

pack-priv final Class DefaultDatabaseClient

extends Object
implements DatabaseClient
Class Inheritance
All Implemented Interfaces
org.springframework.r2dbc.core.DatabaseClient, org.springframework.r2dbc.core.ConnectionAccessor
Imports
java.beans.PropertyDescriptor, java.lang.reflect.InvocationHandler, .InvocationTargetException, .Method, .Proxy, java.util.Collections, .LinkedHashMap, .List, .Map, java.util.concurrent.atomic.AtomicBoolean, java.util.function.BiFunction, .Function, .Supplier, java.util.stream.Collectors, io.r2dbc.spi.Connection, .ConnectionFactory, .Parameter, .Parameters, .R2dbcException, .Readable, .Result, .Row, .RowMetadata, .Statement, .Wrapped, org.apache.commons.logging.Log, .LogFactory, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, org.springframework.beans.BeanUtils, org.springframework.dao.InvalidDataAccessApiUsageException, org.springframework.lang.Nullable, org.springframework.r2dbc.connection.ConnectionFactoryUtils, org.springframework.r2dbc.core.binding.BindMarkersFactory, .BindTarget, org.springframework.util.Assert, .CollectionUtils, .ReflectionUtils, .StringUtils

The default implementation of DatabaseClient, as created by the static factory method.
Authors
Mark Paluch, Mingyuan Wu, Bogdan Ilchyshyn, Simon Baslé, Juergen Hoeller
Since
5.3
See Also
DatabaseClient#create(ConnectionFactory)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
DefaultDatabaseClient.CloseSuppressingInvocationHandler

Invocation handler that suppresses close calls on R2DBC Connections.

pack-priv static class
DefaultDatabaseClient.ConnectionCloseHolder

Holder for a connection that makes sure the close action is invoked atomically only once.

pack-priv class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final BindMarkersFactory
private final ConnectionFactory
private final ExecuteFunction
private final Log
private final NamedParameterExpander

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultDatabaseClient(BindMarkersFactory bindMarkersFactory, ConnectionFactory connectionFactory, ExecuteFunction executeFunction, boolean namedParameters)

Method Summary

Modifier and TypeMethod and Description
private Publisher<Void>

Returns:

a Publisher that completes successfully when the connection is closed
closeConnection
(Connection
to close.
connection
)

Release the Connection.

private static Connection

Returns:

the Connection proxy
createConnectionProxy
(Connection
the R2DBC Connection to create a proxy for
con
)

Create a close-suppressing proxy for the given R2DBC Connection.

private Mono<Connection>

Returns:

a Mono able to emit a Connection
getConnection
()

Obtain a Connection.

public ConnectionFactory
private static String

Returns:

the SQL string, or null
getSql
(Object
an object that is potentially an SqlProvider
object
)

Get SQL from a potential provider object.

public <T> Mono<T>
inConnection(Function<Connection, Mono<T>>
the callback object that specifies the connection action
action
)

Implements org.springframework.r2dbc.core.ConnectionAccessor.inConnection.

Execute a callback Function within a Connection scope.

public <T> Flux<T>
inConnectionMany(Function<Connection, Flux<T>>
the callback object that specifies the connection action
action
)

Implements org.springframework.r2dbc.core.ConnectionAccessor.inConnectionMany.

Execute a callback Function within a Connection scope.

private ConnectionFactory

Returns:

the ConnectionFactory (never null)
obtainConnectionFactory
()

Obtain the ConnectionFactory for actual use.

public DatabaseClient.GenericExecuteSpec
sql(String
the SQL statement
sql
)

Implements org.springframework.r2dbc.core.DatabaseClient.sql.

Specify a static sql statement to run.

public DatabaseClient.GenericExecuteSpec
sql(Supplier<String>
a supplier for the SQL statement
sqlSupplier
)

Implements org.springframework.r2dbc.core.DatabaseClient.sql.

Specify an SQL supplier that provides SQL to run.

private static Mono<Long>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait