Package jslx.dbutilities.dbutil
Class DbCreateTask.DbCreateTaskBuilder
- java.lang.Object
-
- jslx.dbutilities.dbutil.DbCreateTask.DbCreateTaskBuilder
-
- All Implemented Interfaces:
DbCreateTask.AfterTablesOnlyStepIfc,DbCreateTask.DBAddConstraintsStepIfc,DbCreateTask.DBAfterInsertStepIfc,DbCreateTask.DbCreateTaskExecuteStepIfc,DbCreateTask.DbCreateTaskFirstStepIfc,DbCreateTask.DbInsertStepIfc,DbCreateTask.WithCreateScriptStepIfc,DbCreateTask.WithTablesScriptStepIfc
- Enclosing class:
- DbCreateTask
public static final class DbCreateTask.DbCreateTaskBuilder extends java.lang.Object implements DbCreateTask.DbCreateTaskExecuteStepIfc, DbCreateTask.WithCreateScriptStepIfc, DbCreateTask.WithTablesScriptStepIfc, DbCreateTask.DbCreateTaskFirstStepIfc, DbCreateTask.AfterTablesOnlyStepIfc, DbCreateTask.DbInsertStepIfc, DbCreateTask.DBAfterInsertStepIfc, DbCreateTask.DBAddConstraintsStepIfc
A builder that can be used to configure a database creation task through as set of configuration steps.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DbCreateTaskexecute()Finishes the builder process of building the creation commandsDbCreateTask.DbCreateTaskExecuteStepIfcwithConstraints(java.nio.file.Path toAlterScript)DbCreateTask.DbCreateTaskExecuteStepIfcwithCreationScript(java.nio.file.Path pathToScript)DbCreateTask.DBAfterInsertStepIfcwithExcelData(java.nio.file.Path toExcelWorkbook, java.util.List<java.lang.String> tableNamesInInsertOrder)DbCreateTask.DBAfterInsertStepIfcwithInserts(java.nio.file.Path toInsertScript)DbCreateTask.AfterTablesOnlyStepIfcwithTables(java.nio.file.Path pathToScript)
-
-
-
Method Detail
-
withCreationScript
public DbCreateTask.DbCreateTaskExecuteStepIfc withCreationScript(java.nio.file.Path pathToScript)
- Specified by:
withCreationScriptin interfaceDbCreateTask.WithCreateScriptStepIfc- Parameters:
pathToScript- a path to a full creation script that specifies the database, must not be null- Returns:
- A builder step to permit connecting
-
withTables
public DbCreateTask.AfterTablesOnlyStepIfc withTables(java.nio.file.Path pathToScript)
- Specified by:
withTablesin interfaceDbCreateTask.WithTablesScriptStepIfc- Parameters:
pathToScript- a path to a script that specifies the database tables, must not be null- Returns:
- A builder step to permit connecting
-
withExcelData
public DbCreateTask.DBAfterInsertStepIfc withExcelData(java.nio.file.Path toExcelWorkbook, java.util.List<java.lang.String> tableNamesInInsertOrder)
- Specified by:
withExcelDatain interfaceDbCreateTask.DbInsertStepIfc- Parameters:
toExcelWorkbook- a path to an Excel workbook that can be read to insert data into the database, must not be nulltableNamesInInsertOrder- a list of table names that need to be filled. Sheets in the workbook must correspond exactly to these names- Returns:
- a reference to the alter step in the builder process
-
withInserts
public DbCreateTask.DBAfterInsertStepIfc withInserts(java.nio.file.Path toInsertScript)
- Specified by:
withInsertsin interfaceDbCreateTask.DbInsertStepIfc- Parameters:
toInsertScript- a path to an SQL script that can be read to insert data into the database, must not be null- Returns:
- a reference to the alter step in the builder process
-
withConstraints
public DbCreateTask.DbCreateTaskExecuteStepIfc withConstraints(java.nio.file.Path toAlterScript)
- Specified by:
withConstraintsin interfaceDbCreateTask.DBAddConstraintsStepIfc- Parameters:
toAlterScript- a path to an SQL script that can be read to alter the table structure of the database and add constraints, must not be null- Returns:
- a reference to the alter step in the builder process
-
execute
public DbCreateTask execute()
Description copied from interface:DbCreateTask.DbCreateTaskExecuteStepIfcFinishes the builder process of building the creation commands- Specified by:
executein interfaceDbCreateTask.DbCreateTaskExecuteStepIfc- Returns:
- an instance of DbCreateCommandList
-
-