Top Description Fields Constructors Methods
org.jooq.tools.r2dbc

public Class DefaultStatement

extends Object
implements Statement
Class Inheritance
All Implemented Interfaces
io.r2dbc.spi.Statement
Known Direct Subclasses
org.jooq.tools.r2dbc.LoggingStatement
Imports
org.reactivestreams.Publisher, io.r2dbc.spi.Result, .Statement

A default R2DBC Statement implementation delegating all R2DBC calls to an internal getDelegate().
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private final Statement

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Statement
add()

Implements io.r2dbc.spi.Statement.add.

Save the current binding and create a new one to indicate the statement should be executed again with new bindings provided through subsequent calls to bind and bindNull.
public Statement
bind(int
the index to bind to
index
,
Object
the value to bind
value
)

Implements io.r2dbc.spi.Statement.bind.

Bind a non-null value to an indexed parameter.
public Statement
bind(String
the name of identifier to bind to
name
,
Object
the value to bind
value
)

Implements io.r2dbc.spi.Statement.bind.

Bind a non-null to a named parameter.
public Statement
bindNull(int
the index to bind to
index
,
Class<?>
the type of null value
type
)

Implements io.r2dbc.spi.Statement.bindNull.

Bind a null value to an indexed parameter.
public Statement
bindNull(String
the name of identifier to bind to
name
,
Class<?>
the type of null value
type
)

Implements io.r2dbc.spi.Statement.bindNull.

Bind a null value to a named parameter.
public Publisher<? extends Result>
execute()

Implements io.r2dbc.spi.Statement.execute.

Executes one or more SQL statements and returns the Results.
public Statement
fetchSize(int
the number of rows to fetch
rows
)

Overrides default io.r2dbc.spi.Statement.fetchSize.

Configures Statement to retrieve a fixed number of rows when fetching results from a query instead deriving fetch size from back pressure.
public Statement
public Statement
returnGeneratedValues(String...
the names of the columns to return
columns
)

Overrides default io.r2dbc.spi.Statement.returnGeneratedValues.

Configures Statement to return the generated values from any rows created by this Statement in the Result returned from execute().
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final Statement delegate

Constructor Detail

DefaultStatementback to summary
public DefaultStatement(Statement delegate)

Method Detail

addback to summary
public Statement add()

Implements io.r2dbc.spi.Statement.add.

Doc from io.r2dbc.spi.Statement.add.

Save the current binding and create a new one to indicate the statement should be executed again with new bindings provided through subsequent calls to bind and bindNull. For example:

Statement statement = connection.createStatement("INSERT INTO books (author, publisher) VALUES ($1, $2)");
statement.bind(0, "John Doe").bind(1, "Happy Books LLC").add();
statement.bind(0, "Jane Doe").bind(1, "Scary Books Inc");
statement.execute();
Returns:Statement

this Statement

Annotations
@Override
bindback to summary
public Statement bind(int index, Object value)

Implements io.r2dbc.spi.Statement.bind.

Doc from io.r2dbc.spi.Statement.bind.

Bind a non-null value to an indexed parameter. Indexes are zero-based.

Parameters
index:int

the index to bind to

value:Object

the value to bind

Returns:Statement

this Statement

Annotations
@Override
bindback to summary
public Statement bind(String name, Object value)

Implements io.r2dbc.spi.Statement.bind.

Doc from io.r2dbc.spi.Statement.bind.

Bind a non-null to a named parameter.

Parameters
name:String

the name of identifier to bind to

value:Object

the value to bind

Returns:Statement

this Statement

Annotations
@Override
bindNullback to summary
public Statement bindNull(int index, Class<?> type)

Implements io.r2dbc.spi.Statement.bindNull.

Doc from io.r2dbc.spi.Statement.bindNull.

Bind a null value to an indexed parameter. Indexes are zero-based.

Parameters
index:int

the index to bind to

type:Class<?>

the type of null value

Returns:Statement

this Statement

Annotations
@Override
bindNullback to summary
public Statement bindNull(String name, Class<?> type)

Implements io.r2dbc.spi.Statement.bindNull.

Doc from io.r2dbc.spi.Statement.bindNull.

Bind a null value to a named parameter.

Parameters
name:String

the name of identifier to bind to

type:Class<?>

the type of null value

Returns:Statement

this Statement

Annotations
@Override
executeback to summary
public Publisher<? extends Result> execute()

Implements io.r2dbc.spi.Statement.execute.

Doc from io.r2dbc.spi.Statement.execute.

Executes one or more SQL statements and returns the Results. Result objects must be fully consumed to ensure full execution of the Statement. This statement is executed additionally for each binding saved through add().

Returns:Publisher<? extends Result>

the Results, returned by each statement

Annotations
@Override
fetchSizeback to summary
public Statement fetchSize(int rows)

Overrides default io.r2dbc.spi.Statement.fetchSize.

Doc from io.r2dbc.spi.Statement.fetchSize.

Configures Statement to retrieve a fixed number of rows when fetching results from a query instead deriving fetch size from back pressure. If called multiple times, only the fetch size configured in the final invocation will be applied. If the value specified is zero, then the hint is ignored.

The default implementation of this method is a no op and the default value is zero.

Parameters
rows:int

the number of rows to fetch

Returns:Statement

this Statement

Annotations
@Override
getDelegateback to summary
public Statement getDelegate()
returnGeneratedValuesback to summary
public Statement returnGeneratedValues(String... columns)

Overrides default io.r2dbc.spi.Statement.returnGeneratedValues.

Doc from io.r2dbc.spi.Statement.returnGeneratedValues.

Configures Statement to return the generated values from any rows created by this Statement in the Result returned from execute(). If no columns are specified, implementations are free to choose which columns will be returned. If called multiple times, only the columns requested in the final invocation will be returned.

The default implementation of this method is a no-op.

Parameters
columns:String[]

the names of the columns to return

Returns:Statement

this Statement

Annotations
@Override