|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.config.ds.AbstractDataSourceDescriptor.Builder de.smartics.properties.spi.config.ds.DefaultDataSourceManager.Builder
public static class DefaultDataSourceManager.Builder
The builder of manager instances.
Field Summary | |
---|---|
protected DataSourceProxy |
dataSourceProxy The proxy to provide access to a data source. |
static String |
DEFAULT_CREATE_TABLE_TEMPLATE The default table template. |
protected String |
insertOrUpdateSqlStatementTemplate The template to create an SQL statement to insert or update a value in the table, dependent on if the value is already in the database or not. |
Constructor Summary | |
---|---|
DefaultDataSourceManager.Builder() |
Method Summary | |
---|---|
DefaultDataSourceManager |
build() Creates the instance. |
void |
setCreateTableSqlStatementTemplate(String createTableSqlStatementTemplate) Sets the template to create an SQL statement to create the configuration table. |
void |
setDataSourceProxy(DataSourceProxy dataSourceProxy) Sets the proxy to provide access to a data source. |
void |
setDropTable(boolean dropTable) Sets the value for dropTable. |
void |
setIgnoreTableCreationProblems(boolean ignoreTableCreationProblems) Sets the flag signals that any problems encountered on creating the table should be ignored. |
void |
setInitialProperties(Map<String,Map<String,String>> initialProperties) Sets the properties to fill the database initially. |
void |
setInsertOrUpdateSqlStatementTemplate(String insertOrUpdateSqlStatementTemplate) Set the template to insert or update a value in the configuration table. |
Methods inherited from class de.smartics.properties.spi.config.ds.AbstractDataSourceDescriptor.Builder |
---|
setConfigColumn, setNameColumn, setTable, setValueColumn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CREATE_TABLE_TEMPLATE
The value of this constant is "CREATE TABLE IF NOT EXISTS ${table} (${configColumn} VARCHAR(128) NOT NULL, ${nameColumn} VARCHAR(64) NOT NULL, ${valueColumn} VARCHAR(255), CONSTRAINT prime UNIQUE (${configColumn}, ${nameColumn}))".
"CREATE TABLE IF NOT EXISTS ${table} (${configColumn} VARCHAR(128) NOT NULL, ${nameColumn} VARCHAR(64) NOT NULL, ${valueColumn} VARCHAR(255), CONSTRAINT prime UNIQUE (${configColumn}, ${nameColumn}))"
protected DataSourceProxy dataSourceProxy
protected String insertOrUpdateSqlStatementTemplate
${table}
,
${configColumn}
,
${nameColumn}
and
${valueColumn}
to reference the name of the configuration table, the column that stores the property names and the column storing the property values.
Constructor Detail |
---|
public DefaultDataSourceManager.Builder()
Method Detail |
---|
public final void setCreateTableSqlStatementTemplate(String createTableSqlStatementTemplate)
${table}
,
${configColumn}
,
${nameColumn}
and
${valueColumn}
to reference the name of the configuration table, the column that stores the property names and the column storing the property values.
Per default the default table template
is used.
createTableSqlStatementTemplate
- the template to create an SQL statement to create the configuration table.
DEFAULT_CREATE_TABLE_TEMPLATE
public void setInsertOrUpdateSqlStatementTemplate(String insertOrUpdateSqlStatementTemplate)
insertOrUpdateSqlStatementTemplate
- the template to set.
public final void setDataSourceProxy(DataSourceProxy dataSourceProxy) throws NullPointerException
dataSourceProxy
- the proxy to provide access to a data source.
NullPointerException
- of
dataSourceProxy
is
null
.
public final void setInitialProperties(Map<String,Map<String,String>> initialProperties)
null
.
initialProperties
- the properties to fill the database initially.
public final void setDropTable(boolean dropTable)
Signals to drop the properties table before creation.
dropTable
- the value for dropTable.
public final void setIgnoreTableCreationProblems(boolean ignoreTableCreationProblems)
ignoreTableCreationProblems
- the flag signals that any problems encountered on creating the table should be ignored.
public DefaultDataSourceManager build() throws NullPointerException
NullPointerException
- if no data source proxy has been provided.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |