Package de.chojo.sqlutil.updater
Class SqlUpdater.SqlUpdaterBuilder<T extends JdbcConfig<?>>
java.lang.Object
de.chojo.sqlutil.updater.SqlUpdater.SqlUpdaterBuilder<T>
- Type Parameters:
T- The type of the jdbc link defined by theSqlType
- Enclosing class:
- SqlUpdater<T extends JdbcConfig<?>>
Class to build a
SqlUpdater with a builder pattern-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Build the updater and start the update process.setReplacements(QueryReplacement... replacements) Replacements which should be applied to the executed scripts.setSchemas(String... schemas) Set the schemas which should be created if they do not exist.setVersionTable(String versionTable) The version table which contains major and patch version.withConfig(QueryBuilderConfig config) Set theQueryBuilderConfigfor the underlyingQueryFactoryHolderwithLogger(LoggerAdapter logger) Set a logger adapter used for logging.
-
Method Details
-
setSchemas
Set the schemas which should be created if they do not exist.- Parameters:
schemas- schemas- Returns:
- builder instance
-
setVersionTable
The version table which contains major and patch version.Changing this later might cause a loss of data.
- Parameters:
versionTable- name of the version table- Returns:
- builder instance
-
setReplacements
Replacements which should be applied to the executed scripts. Can be used to change schema names or other variables during deployment- Parameters:
replacements- replacements- Returns:
- builder instance
-
withLogger
Set a logger adapter used for logging.- Parameters:
logger- logger adapter- Returns:
- builder instance
-
withConfig
Set theQueryBuilderConfigfor the underlyingQueryFactoryHolder- Parameters:
config- config so apply- Returns:
- builder instance
-
execute
Build the updater and start the update process.- Throws:
SQLException- If execution of the scripts failsIOException- If the scripts can't be read.
-