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 SummaryModifier 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.bindProperties(Object source) Bind the bean properties or record components from the given source object, registering each as a named parameter.bindValues(List<?> source) Bind the parameter values from the given source list, registering each as a positional parameter using their order in the given list as their index.bindValues(Map<String, ?> source) Bind the parameter values from the given source map, registering each as a parameter with the map key as name.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.<R> RowsFetchSpec<R>mapProperties(Class<R> mappedClass) Configure a row mapper for the given mapped class and enter the execution stage.<R> RowsFetchSpec<R>Configure a mapping for values in the first column and 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- 
bindBind a non-nullvalue to a parameter identified by itsindex.- Parameters:
- index- zero based index to bind the parameter to
- value- either a scalar value or a- Parameter
 
- 
bindNullBind anullvalue to a parameter identified by itsindex.- Parameters:
- index- zero based index to bind the parameter to
- type- the parameter type
 
- 
bindBind a non-nullvalue to a parameter identified by itsname.- Parameters:
- name- the name of the parameter
- value- either a scalar value or a- Parameter
 
- 
bindNullBind anullvalue to a parameter identified by itsname.- Parameters:
- name- the name of the parameter
- type- the parameter type
 
- 
bindValuesBind the parameter values from the given source list, registering each as a positional parameter using their order in the given list as their index.- Parameters:
- source- the source list of parameters, with their order as position and each value either a scalar value or a- Parameter
- Since:
- 6.2
- See Also:
 
- 
bindValuesBind the parameter values from the given source map, registering each as a parameter with the map key as name.- Parameters:
- source- the source map of parameters, with keys as names and each value either a scalar value or a- Parameter
- Since:
- 6.1
- See Also:
 
- 
bindPropertiesBind the bean properties or record components from the given source object, registering each as a named parameter.- Parameters:
- source- the source object (a JavaBean or record)
- Since:
- 6.1
- See Also:
 
- 
filterdefault 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
 
- 
filterAdd 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
 
- 
mapConfigure a result mappingfunctionand enter the execution stage.- Type Parameters:
- R- the result type
- Parameters:
- mappingFunction- a function that maps from- Readableto the result type
- Returns:
- a RowsFetchSpecfor configuration what to fetch
- Since:
- 6.0
 
- 
mapConfigure a result mappingfunctionand enter the execution stage.- Type Parameters:
- R- the result type
- Parameters:
- mappingFunction- a function that maps from- Rowand- RowMetadatato the result type
- Returns:
- a RowsFetchSpecfor configuration what to fetch
 
- 
mapValueConfigure a mapping for values in the first column and enter the execution stage.- Type Parameters:
- R- the result type
- Parameters:
- mappedClass- the target class (a database-supported value class)
- Returns:
- a RowsFetchSpecfor configuration what to fetch
- Since:
- 6.1
- See Also:
 
- 
mapPropertiesConfigure a row mapper for the given mapped class and enter the execution stage.- Type Parameters:
- R- the result type
- Parameters:
- mappedClass- the target class (a JavaBean or record) with properties to map to (bean properties or record components)
- Returns:
- a RowsFetchSpecfor configuration what to fetch
- Since:
- 6.1
- See Also:
 
- 
flatMap- Type Parameters:
- R- the result type
- Parameters:
- mappingFunction- a function that maps from- Resultinto a result publisher
- Returns:
- a Fluxthat emits mapped elements
- Since:
- 6.0
- See Also:
 
- 
fetchPerform the SQL call and retrieve the result by entering the execution stage.
- 
thenreactor.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)
 
 
-