Interface DbClientProviderBuilder<T extends DbClientProviderBuilder<T>>

Type Parameters:
T - type of the builder extending implementing this interface.
All Superinterfaces:
io.helidon.common.Builder<T,DbClient>, Supplier<DbClient>

public interface DbClientProviderBuilder<T extends DbClientProviderBuilder<T>> extends io.helidon.common.Builder<T,DbClient>
Database provider builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    <TYPE> T
    addMapper(DbMapper<TYPE> dbMapper, io.helidon.common.GenericType<TYPE> mappedType)
    Add a custom mapper with generic types support.
    <TYPE> T
    addMapper(DbMapper<TYPE> dbMapper, Class<TYPE> mappedClass)
    Add a custom mapper.
    Database schema mappers provider.
    addService(DbClientService clientService)
    Add an interceptor.
    Build database handler for specific provider.
    config(Config config)
    Use database connection configuration from configuration file.
    Mapper manager for generic mapping, such as mapping of parameters to expected types.
    password(String password)
    Set database connection p¨assword.
    Statements to use either from configuration or manually configured.
    url(String url)
    Set database connection string (URL).
    username(String username)
    Set database connection user name.

    Methods inherited from interface io.helidon.common.Builder

    get, identity, update
  • Method Details

    • config

      T config(Config config)
      Use database connection configuration from configuration file.
      Parameters:
      config - Config instance with database connection attributes
      Returns:
      database provider builder
    • url

      T url(String url)
      Set database connection string (URL).
      Parameters:
      url - database connection string
      Returns:
      database provider builder
    • username

      T username(String username)
      Set database connection user name.
      Parameters:
      username - database connection user name
      Returns:
      database provider builder
    • password

      T password(String password)
      Set database connection p¨assword.
      Parameters:
      password - database connection password
      Returns:
      database provider builder
    • statements

      T statements(DbStatements statements)
      Statements to use either from configuration or manually configured.
      Parameters:
      statements - Statements to use
      Returns:
      updated builder instance
    • addMapperProvider

      T addMapperProvider(DbMapperProvider provider)
      Database schema mappers provider.
      Parameters:
      provider - database schema mappers provider to use
      Returns:
      updated builder instance
    • addMapper

      <TYPE> T addMapper(DbMapper<TYPE> dbMapper, Class<TYPE> mappedClass)
      Add a custom mapper.
      Type Parameters:
      TYPE - type of the supported class
      Parameters:
      dbMapper - the mapper capable of mapping the mappedClass to various database objects
      mappedClass - class that this mapper supports
      Returns:
      updated builder instance.
    • addMapper

      <TYPE> T addMapper(DbMapper<TYPE> dbMapper, io.helidon.common.GenericType<TYPE> mappedType)
      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 objects
      mappedType - type that this mapper supports
      Returns:
      updated builder instance.
    • mapperManager

      T mapperManager(MapperManager manager)
      Mapper manager for generic mapping, such as mapping of parameters to expected types.
      Parameters:
      manager - mapper manager
      Returns:
      updated builder instance
    • addService

      T addService(DbClientService clientService)
      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
    • build

      DbClient build()
      Build database handler for specific provider.
      Specified by:
      build in interface io.helidon.common.Builder<T extends DbClientProviderBuilder<T>,DbClient>
      Returns:
      database handler instance