Class DbClient.Builder

java.lang.Object
io.helidon.dbclient.DbClient.Builder
All Implemented Interfaces:
Builder<DbClient.Builder,DbClient>, Supplier<DbClient>
Enclosing interface:
DbClient

public static final class DbClient.Builder extends Object implements Builder<DbClient.Builder,DbClient>
Helidon database handler builder.
  • Method Details

    • build

      public DbClient build()
      Build provider specific database handler.
      Specified by:
      build in interface Builder<DbClient.Builder,DbClient>
      Returns:
      new database handler instance
    • addServiceProvider

      public DbClient.Builder addServiceProvider(DbClientServiceProvider provider)
      Add an interceptor provider. The provider is only used when configuration is used (config(io.helidon.config.Config).
      Parameters:
      provider - provider to add to the list of loaded providers
      Returns:
      updated builder instance
    • addService

      public DbClient.Builder addService(DbClientService clientService)
      Add a client service.
      Parameters:
      clientService - clientService to apply
      Returns:
      updated builder instance
    • addService

      public DbClient.Builder addService(Supplier<? extends DbClientService> clientServiceSupplier)
      Add a client service.
      Parameters:
      clientServiceSupplier - supplier of client service
      Returns:
      updated builder instance
    • config

      public DbClient.Builder config(Config config)
      Use database connection configuration from configuration file.
      Parameters:
      config - Config instance with database connection attributes
      Returns:
      database provider builder
    • statements

      public DbClient.Builder statements(DbStatements statements)
      Statements to use either from configuration or manually configured.
      Parameters:
      statements - Statements to use
      Returns:
      updated builder instance
    • mapperProvider

      public DbClient.Builder mapperProvider(DbMapperProvider provider)
      Database schema mappers provider. Mappers associated with types in this provider will override existing types associations loaded as DbMapperProvider Java services.
      Parameters:
      provider - database schema mappers provider to use
      Returns:
      updated builder instance
    • mapperManager

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