Class DatabaseBuilderParametersImpl
- java.lang.Object
-
- org.apache.commons.configuration2.builder.BasicBuilderParameters
-
- org.apache.commons.configuration2.builder.DatabaseBuilderParametersImpl
-
- All Implemented Interfaces:
java.lang.Cloneable
,BasicBuilderProperties<BasicBuilderParameters>
,BuilderParameters
,DatabaseBuilderProperties<DatabaseBuilderParametersImpl>
public class DatabaseBuilderParametersImpl extends BasicBuilderParameters implements DatabaseBuilderProperties<DatabaseBuilderParametersImpl>
A specialized parameters object for database configurations.
This class has properties for defining the database structures the configuration operates on.
This class is not thread-safe. It is intended that an instance is constructed and initialized by a single thread during configuration of a
ConfigurationBuilder
.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.configuration2.builder.BuilderParameters
RESERVED_PARAMETER_PREFIX
-
-
Constructor Summary
Constructors Constructor Description DatabaseBuilderParametersImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabaseBuilderParametersImpl
setAutoCommit(boolean f)
Enables or disable auto commit mode.DatabaseBuilderParametersImpl
setConfigurationName(java.lang.String name)
Sets the name of this configuration instance.DatabaseBuilderParametersImpl
setConfigurationNameColumn(java.lang.String name)
Sets the name of the table column containing the configuration name.DatabaseBuilderParametersImpl
setDataSource(javax.sql.DataSource src)
Sets the data source for the database configuration.DatabaseBuilderParametersImpl
setKeyColumn(java.lang.String name)
Sets the name of the table column containing configuration keys.DatabaseBuilderParametersImpl
setTable(java.lang.String tableName)
Sets the name of the table containing configuration data.DatabaseBuilderParametersImpl
setValueColumn(java.lang.String name)
Sets the name of the table column containing the configuration property value.-
Methods inherited from class org.apache.commons.configuration2.builder.BasicBuilderParameters
clone, copyPropertiesFrom, fetchBeanHelper, fetchInterpolatorSpecification, fetchProperty, getParameters, inheritFrom, merge, setBeanHelper, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setSynchronizer, setThrowExceptionOnMissing, storeProperty
-
-
-
-
Method Detail
-
setDataSource
public DatabaseBuilderParametersImpl setDataSource(javax.sql.DataSource src)
Description copied from interface:DatabaseBuilderProperties
Sets the data source for the database configuration. All database connections are obtained from this data source. This is a mandatory property.- Specified by:
setDataSource
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
src
- the data source for the database configuration- Returns:
- a reference to this object for method chaining
-
setTable
public DatabaseBuilderParametersImpl setTable(java.lang.String tableName)
Description copied from interface:DatabaseBuilderProperties
Sets the name of the table containing configuration data. Database configuration will access this database table. This is a mandatory property.- Specified by:
setTable
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
tableName
- the name of the table with configuration data- Returns:
- a reference to this object for method chaining
-
setKeyColumn
public DatabaseBuilderParametersImpl setKeyColumn(java.lang.String name)
Description copied from interface:DatabaseBuilderProperties
Sets the name of the table column containing configuration keys. This is a mandatory property.- Specified by:
setKeyColumn
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
name
- the column name- Returns:
- a reference to this object for method chaining
-
setValueColumn
public DatabaseBuilderParametersImpl setValueColumn(java.lang.String name)
Description copied from interface:DatabaseBuilderProperties
Sets the name of the table column containing the configuration property value. This is a mandatory property.- Specified by:
setValueColumn
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
name
- the column name- Returns:
- a reference to this object for method chaining
-
setConfigurationNameColumn
public DatabaseBuilderParametersImpl setConfigurationNameColumn(java.lang.String name)
Description copied from interface:DatabaseBuilderProperties
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.- Specified by:
setConfigurationNameColumn
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
name
- the column name- Returns:
- a reference to this method for method chaining
-
setConfigurationName
public DatabaseBuilderParametersImpl setConfigurationName(java.lang.String name)
Description copied from interface:DatabaseBuilderProperties
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.- Specified by:
setConfigurationName
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
name
- the name of this configuration instance- Returns:
- a reference to this object for method chaining
-
setAutoCommit
public DatabaseBuilderParametersImpl setAutoCommit(boolean f)
Description copied from interface:DatabaseBuilderProperties
Enables or disable auto commit mode. If enabled, the database configuration instance performs a commit after each database update.- Specified by:
setAutoCommit
in interfaceDatabaseBuilderProperties<DatabaseBuilderParametersImpl>
- Parameters:
f
- the value of the auto commit flag- Returns:
- a reference to this object for method chaining
-
-