Module io.helidon.dbclient
Package io.helidon.dbclient
Interface DbStatement<D extends DbStatement<D,R>,R>
-
- Type Parameters:
R- Type of the result of this statement (e.g. aCompletionStage)D- Type of the descendant of this class
- All Known Subinterfaces:
DbStatementDml,DbStatementGet,DbStatementQuery
- All Known Implementing Classes:
AbstractStatement,MongoDbStatementDml,MongoDbStatementGet
public interface DbStatement<D extends DbStatement<D,R>,R>Database statement that can process parameters. Methodexecute()processes the statement and returns appropriate response.All methods are non-blocking. The
execute()method returns either aCompletionStageor another object that provides similar API for eventual processing of the response.Once parameters are set using one of the
paramsmethods, all other methods throw anIllegalStateException.Once a parameter is added using
addParam(Object)oraddParam(String, Object), all otherparamsmethods throw anIllegalStateException.Once
execute()is called, all methods would throw anIllegalStateException.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DaddParam(Object parameter)Add next parameter to the list of ordered parameters (e.g.DaddParam(String name, Object parameter)Add next parameter to the map of named parameters (e.g.Rexecute()Execute this statement using the parameters configured withparamsandaddParamsmethods.DindexedParam(Object parameters)Configure parameters usingObjectinstance with registered mapper.DnamedParam(Object parameters)Configure parameters usingObjectinstance with registered mapper.default Dparams(Object... parameters)Configure parameters from an array by order.Dparams(List<?> parameters)Configure parameters from aListby order.Dparams(Map<String,?> parameters)Configure named parameters.
-
-
-
Method Detail
-
params
D params(List<?> parameters)
Configure parameters from aListby order. The statement must use indexed parameters and configure them by order in the provided array.- Parameters:
parameters- ordered parameters to set on this statement, never null- Returns:
- updated db statement
-
params
default D params(Object... parameters)
Configure parameters from an array by order. The statement must use indexed parameters and configure them by order in the provided array.- Parameters:
parameters- ordered parameters to set on this statement- Returns:
- updated db statement
-
params
D params(Map<String,?> parameters)
Configure named parameters. The statement must use named parameters and configure them from the provided map.- Parameters:
parameters- named parameters to set on this statement- Returns:
- updated db statement
-
namedParam
D namedParam(Object parameters)
Configure parameters usingObjectinstance with registered mapper. The statement must use named parameters and configure them from the map provided by mapper.- Parameters:
parameters-Objectinstance containing parameters- Returns:
- updated db statement
-
indexedParam
D indexedParam(Object parameters)
Configure parameters usingObjectinstance with registered mapper. The statement must use indexed parameters and configure them by order in the array provided by mapper.- Parameters:
parameters-Objectinstance containing parameters- Returns:
- updated db statement
-
addParam
D addParam(Object parameter)
Add next parameter to the list of ordered parameters (e.g. the ones that use?in SQL).- Parameters:
parameter- next parameter to set on this statement- Returns:
- updated db statement
-
addParam
D addParam(String name, Object parameter)
Add next parameter to the map of named parameters (e.g. the ones that use:namein Helidon JDBC SQL integration).- Parameters:
name- name of parameterparameter- value of parameter- Returns:
- updated db statement
-
execute
R execute()
Execute this statement using the parameters configured withparamsandaddParamsmethods.- Returns:
- The result of this statement, never blocking.
-
-