public class ProxyUtils extends Object
Connection
from proxy class.Modifier and Type | Method and Description |
---|---|
static Optional<io.r2dbc.spi.Connection> |
unwrapConnection(io.r2dbc.spi.Batch batch)
Get original
Connection from proxy Batch . |
static Optional<io.r2dbc.spi.Connection> |
unwrapConnection(io.r2dbc.spi.Connection connection)
Get original
Connection if given Connection has implemented Wrapped . |
static Optional<io.r2dbc.spi.Connection> |
unwrapConnection(io.r2dbc.spi.Result result)
Get original
Connection from proxy Result . |
static Optional<io.r2dbc.spi.Connection> |
unwrapConnection(io.r2dbc.spi.Statement statement)
Get original
Connection from proxy Statement . |
public static Optional<io.r2dbc.spi.Connection> unwrapConnection(io.r2dbc.spi.Connection connection)
Connection
if given Connection
has implemented Wrapped
.connection
- a connectionIllegalArgumentException
- if connection
is null
public static Optional<io.r2dbc.spi.Connection> unwrapConnection(io.r2dbc.spi.Batch batch)
Connection
from proxy Batch
.
When provided Batch
is a proxy that implements ConnectionHolder
, retrieves original
Connection
; otherwise, returns empty Optional
.batch
- a batchIllegalArgumentException
- if batch
is null
public static Optional<io.r2dbc.spi.Connection> unwrapConnection(io.r2dbc.spi.Statement statement)
Connection
from proxy Statement
.
When provided Statement
is a proxy that implements ConnectionHolder
, retrieves original
Connection
; otherwise, returns empty Optional
.statement
- a statementIllegalArgumentException
- if statement
is null
public static Optional<io.r2dbc.spi.Connection> unwrapConnection(io.r2dbc.spi.Result result)
Connection
from proxy Result
.
When provided Result
is a proxy that implements ConnectionHolder
, retrieves original
Connection
; otherwise, returns empty Optional
.result
- a statementIllegalArgumentException
- if result
is null
Copyright © 2024. All rights reserved.