Interface DatabaseBuilderProperties<T>

  • Type Parameters:
    T - the type of the result of all set methods for method chaining
    All Known Subinterfaces:
    DatabaseBuilderParameters
    All Known Implementing Classes:
    DatabaseBuilderParametersImpl

    public interface DatabaseBuilderProperties<T>

    Definition of a properties interface for parameters of a database configuration.

    The properties defined by this interface are used to configure a DatabaseConfiguration instance. They mainly specify the database tables containing configuration properties. Note that many properties are mandatory; they must be provided, otherwise the builder for database configurations throws an exception.

    Important note: This interface is not intended to be implemented by client code! It defines a set of available properties and may be extended even in minor releases.

    Since:
    2.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T setAutoCommit​(boolean f)
      Enables or disable auto commit mode.
      T setConfigurationName​(java.lang.String name)
      Sets the name of this configuration instance.
      T setConfigurationNameColumn​(java.lang.String name)
      Sets the name of the table column containing the configuration name.
      T setDataSource​(javax.sql.DataSource src)
      Sets the data source for the database configuration.
      T setKeyColumn​(java.lang.String name)
      Sets the name of the table column containing configuration keys.
      T setTable​(java.lang.String tname)
      Sets the name of the table containing configuration data.
      T setValueColumn​(java.lang.String name)
      Sets the name of the table column containing the configuration property value.
    • Method Detail

      • setDataSource

        T setDataSource​(javax.sql.DataSource src)
        Sets the data source for the database configuration. All database connections are obtained from this data source. This is a mandatory property.
        Parameters:
        src - the data source for the database configuration
        Returns:
        a reference to this object for method chaining
      • setTable

        T setTable​(java.lang.String tname)
        Sets the name of the table containing configuration data. Database configuration will access this database table. This is a mandatory property.
        Parameters:
        tname - the name of the table with configuration data
        Returns:
        a reference to this object for method chaining
      • setKeyColumn

        T setKeyColumn​(java.lang.String name)
        Sets the name of the table column containing configuration keys. This is a mandatory property.
        Parameters:
        name - the column name
        Returns:
        a reference to this object for method chaining
      • setValueColumn

        T setValueColumn​(java.lang.String name)
        Sets the name of the table column containing the configuration property value. This is a mandatory property.
        Parameters:
        name - the column name
        Returns:
        a reference to this object for method chaining
      • setConfigurationNameColumn

        T setConfigurationNameColumn​(java.lang.String name)
        Sets the name of the table column containing the configuration name. This property is needed if a single database table contains the data of multiple configuration instances. Then this column is used as discriminator to select a specific configuration instance.
        Parameters:
        name - the column name
        Returns:
        a reference to this method for method chaining
      • setConfigurationName

        T setConfigurationName​(java.lang.String name)
        Sets the name of this configuration instance. This property is needed if a single database table contains the data of multiple configuration instances. Then SQL statements generated by the configuration contain an additional constraint filtering the configuration name column for this name.
        Parameters:
        name - the name of this configuration instance
        Returns:
        a reference to this object for method chaining
      • setAutoCommit

        T setAutoCommit​(boolean f)
        Enables or disable auto commit mode. If enabled, the database configuration instance performs a commit after each database update.
        Parameters:
        f - the value of the auto commit flag
        Returns:
        a reference to this object for method chaining