Interface SimpleConfig

All Superinterfaces:
Config

public interface SimpleConfig extends Config
Represents a simplified configuration interface that extends the base Config interface. It provides methods for accessing specific configuration components and constructing builder instances for creating configuration objects.
     SimpleConfig config = SimpleConfig.builder("jdbc:h2:mem:test")
       .naming(Naming.SNAKE_UPPER_CASE)
       .queryTimeout(10)
       .build();
 
This configuration uses Doma's local transaction manager. If you're using Doma with Spring Framework or Quarkus, avoid using this class.
  • Method Details

    • getLocalTransactionDataSource

      LocalTransactionDataSource getLocalTransactionDataSource()
      Retrieves the LocalTransactionDataSource associated with this configuration.
      Returns:
      an instance of LocalTransactionDataSource for managing local database connections and transactions
    • getLocalTransactionManager

      LocalTransactionManager getLocalTransactionManager()
      Retrieves the LocalTransactionManager associated with this configuration.
      Returns:
      an instance of LocalTransactionManager for managing local transactions
    • builder

      static SimpleConfigBuilder builder(String url)
      Creates a new instance of SimpleConfigBuilder with the specified URL.

      You can use a specially modified JDBC URL for Testcontainers as follows:

           jdbc:tc:postgresql:12.20:///test?TC_DAEMON=true
       
      The Dialect is inferred from the URL information.
      Parameters:
      url - the database URL to be used for the configuration; must not be null
      Returns:
      an instance of SimpleConfigBuilder initialized with the given URL
      Throws:
      NullPointerException - if the URL is null
    • builder

      static SimpleConfigBuilder builder(String url, String user, String password)
      Creates a new instance of SimpleConfigBuilder with the specified database URL, username, and password.

      You can use a specially modified JDBC URL for Testcontainers as follows:

           jdbc:tc:postgresql:12.20:///test?TC_DAEMON=true
       
      The Dialect is inferred from the URL information.
      Parameters:
      url - the database URL to be used for the configuration; must not be null
      user - the username to be used for the database connection; can be null
      password - the password to be used for the database connection; can be null
      Returns:
      an instance of SimpleConfigBuilder initialized with the specified parameters
      Throws:
      NullPointerException - if the URL is null
    • builder

      static SimpleConfigBuilder builder(DataSource dataSource, Dialect dialect)
      Creates a new instance of SimpleConfigBuilder with the specified DataSource and Dialect.
      Parameters:
      dataSource - the data source to be used for the configuration; must not be null
      dialect - the dialect to be used for the configuration; must not be null
      Returns:
      an instance of SimpleConfigBuilder initialized with the provided DataSource and Dialect
      Throws:
      NullPointerException - if the dataSource or dialect is null