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 Modifier and Type Field Description private static java.lang.String
PROP_AUTO_COMMIT
Constant for the auto commit property.private static java.lang.String
PROP_CONFIG_NAME
Constant for the configuration name property.private static java.lang.String
PROP_CONFIG_NAME_COLUMN
Constant for the configuration name column property.private static java.lang.String
PROP_DATA_SOURCE
Constant for the data source property.private static java.lang.String
PROP_KEY_COLUMN
Constant for the key column property.private static java.lang.String
PROP_TABLE
Constant for the table property.private static java.lang.String
PROP_VALUE_COLUMN
Constant for the value column property.-
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
-
-
-
-
Field Detail
-
PROP_DATA_SOURCE
private static final java.lang.String PROP_DATA_SOURCE
Constant for the data source property.- See Also:
- Constant Field Values
-
PROP_TABLE
private static final java.lang.String PROP_TABLE
Constant for the table property.- See Also:
- Constant Field Values
-
PROP_KEY_COLUMN
private static final java.lang.String PROP_KEY_COLUMN
Constant for the key column property.- See Also:
- Constant Field Values
-
PROP_VALUE_COLUMN
private static final java.lang.String PROP_VALUE_COLUMN
Constant for the value column property.- See Also:
- Constant Field Values
-
PROP_CONFIG_NAME_COLUMN
private static final java.lang.String PROP_CONFIG_NAME_COLUMN
Constant for the configuration name column property.- See Also:
- Constant Field Values
-
PROP_CONFIG_NAME
private static final java.lang.String PROP_CONFIG_NAME
Constant for the configuration name property.- See Also:
- Constant Field Values
-
PROP_AUTO_COMMIT
private static final java.lang.String PROP_AUTO_COMMIT
Constant for the auto commit property.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
-