Module io.helidon.dbclient
Package io.helidon.dbclient.spi
Interface DbClientBuilder<T extends DbClientBuilder<T>>
- Type Parameters:
T
- type of the builder extending or implementing this interface.
- All Known Implementing Classes:
DbClientBuilderBase
,JdbcClientBuilder
,MongoDbClientBuilder
Provider specific
DbClient
builder.-
Method Summary
Modifier and TypeMethodDescription<TYPE> T
addMapper
(DbMapper<TYPE> dbMapper, GenericType<TYPE> mappedType) Add a custom mapper with generic types support.<TYPE> T
Add a custom mapper.addMapperProvider
(DbMapperProvider provider) Database schema mappers provider.addService
(DbClientService clientService) Add an interceptor.Use database connection configuration from configuration file.dbMapperManager
(DbMapperManager manager) Mapper manager of all configuredmappers
.mapperManager
(MapperManager manager) Mapper manager for generic mapping, such as mapping of parameters to expected types.missingMapParametersAsNull
(boolean missingMapParametersAsNull) Missing values in named parametersMap
are considered as null values.Set database connection password.statements
(DbStatements statements) Statements to use either from configuration or manually configured.Set database connection string (URL).Set database connection username.
-
Method Details
-
config
Use database connection configuration from configuration file.- Parameters:
config
-Config
instance with database connection attributes- Returns:
- database provider builder
-
url
Set database connection string (URL).- Parameters:
url
- database connection string- Returns:
- database provider builder
-
username
Set database connection username.- Parameters:
username
- database connection user name- Returns:
- database provider builder
-
password
Set database connection password.- Parameters:
password
- database connection password- Returns:
- database provider builder
-
missingMapParametersAsNull
Missing values in named parametersMap
are considered as null values. When set totrue
, named parameters value missing in theMap
is considered asnull
. When set tofalse
, any parameter value missing in theMap
will cause an exception.- Parameters:
missingMapParametersAsNull
- whether missing values in named parametersMap
are considered as null values- Returns:
- updated builder instance
-
statements
Statements to use either from configuration or manually configured.- Parameters:
statements
- Statements to use- Returns:
- updated builder instance
-
addMapperProvider
Database schema mappers provider.- Parameters:
provider
- database schema mappers provider to use- Returns:
- updated builder instance
-
addMapper
Add a custom mapper.- Type Parameters:
TYPE
- type of the supported class- Parameters:
dbMapper
- the mapper capable of mapping the mappedClass to various database objectsmappedClass
- class that this mapper supports- Returns:
- updated builder instance.
-
addMapper
Add a custom mapper with generic types support.- Type Parameters:
TYPE
- type of the supported class- Parameters:
dbMapper
- the mapper capable of mapping the mappedClass to various database objectsmappedType
- type that this mapper supports- Returns:
- updated builder instance.
-
mapperManager
Mapper manager for generic mapping, such as mapping of parameters to expected types.- Parameters:
manager
- mapper manager- Returns:
- updated builder instance
-
dbMapperManager
Mapper manager of all configuredmappers
.- Parameters:
manager
- mapper manager- Returns:
- updated builder instance
-
addService
Add an interceptor. This allows to add implementation of tracing, metrics, logging etc. without the need to hard-code these into the base.- Parameters:
clientService
- interceptor instance- Returns:
- updated builder instance
-