Package org.springframework.r2dbc.core
Interface DatabaseClient.GenericExecuteSpec
- Enclosing interface:
- DatabaseClient
public static interface DatabaseClient.GenericExecuteSpec
Contract for specifying an SQL call along with options leading to the execution.
-
Method Summary
Modifier and TypeMethodDescriptionBind a non-nullvalue to a parameter identified by itsindex.Bind a non-nullvalue to a parameter identified by itsname.Bind anullvalue to a parameter identified by itsindex.Bind anullvalue to a parameter identified by itsname.fetch()Perform the SQL call and retrieve the result by entering the execution stage.Add the given filter to the end of the filter chain.filter(StatementFilterFunction filter) Add the given filter to the end of the filter chain.<R> reactor.core.publisher.Flux<R><R> RowsFetchSpec<R>map(BiFunction<Row, RowMetadata, R> mappingFunction) Configure a result mappingfunctionand enter the execution stage.<R> RowsFetchSpec<R>Configure a result mappingfunctionand enter the execution stage.reactor.core.publisher.Mono<Void>then()Perform the SQL call and return aMonothat completes without result on statement completion.
-
Method Details
-
bind
Bind a non-nullvalue to a parameter identified by itsindex.valuecan be either a scalar value orParameter.- Parameters:
index- zero based index to bind the parameter tovalue- either a scalar value orParameter
-
bindNull
Bind anullvalue to a parameter identified by itsindex.- Parameters:
index- zero based index to bind the parameter totype- the parameter type
-
bind
Bind a non-nullvalue to a parameter identified by itsname.- Parameters:
name- the name of the parametervalue- the value to bind
-
bindNull
Bind anullvalue to a parameter identified by itsname.- Parameters:
name- the name of the parametertype- the parameter type
-
filter
default DatabaseClient.GenericExecuteSpec filter(Function<? super Statement, ? extends Statement> filterFunction) Add the given filter to the end of the filter chain.Filter functions are typically used to invoke methods on the Statement before it is executed. For example:
DatabaseClient client = …; client.sql("SELECT book_id FROM book").filter(statement -> statement.fetchSize(100))- Parameters:
filterFunction- the filter to be added to the chain
-
filter
Add the given filter to the end of the filter chain.Filter functions are typically used to invoke methods on the Statement before it is executed. For example:
DatabaseClient client = …; client.sql("SELECT book_id FROM book").filter((statement, next) -> next.execute(statement.fetchSize(100)))- Parameters:
filter- the filter to be added to the chain
-
map
Configure a result mappingfunctionand enter the execution stage. -
map
Configure a result mappingfunctionand enter the execution stage.- Type Parameters:
R- the result type- Parameters:
mappingFunction- a function that maps fromRowandRowMetadatato the result type- Returns:
- a
FetchSpecfor configuration what to fetch
-
flatMap
- Type Parameters:
R- the result type- Parameters:
mappingFunction- a function that maps fromResultinto a result publisher- Returns:
- a
Fluxemitting mapped elements - Since:
- 6.0
- See Also:
-
fetch
Perform the SQL call and retrieve the result by entering the execution stage. -
then
reactor.core.publisher.Mono<Void> then()Perform the SQL call and return aMonothat completes without result on statement completion.- Returns:
- a
Monoignoring its payload (actively dropping)
-