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 DbCreateTask
execute()
Finishes the builder process of building the creation commandsDbCreateTask.DbCreateTaskExecuteStepIfc
withConstraints(java.nio.file.Path toAlterScript)
DbCreateTask.DbCreateTaskExecuteStepIfc
withCreationScript(java.nio.file.Path pathToScript)
DbCreateTask.DBAfterInsertStepIfc
withExcelData(java.nio.file.Path toExcelWorkbook, java.util.List<java.lang.String> tableNamesInInsertOrder)
DbCreateTask.DBAfterInsertStepIfc
withInserts(java.nio.file.Path toInsertScript)
DbCreateTask.AfterTablesOnlyStepIfc
withTables(java.nio.file.Path pathToScript)
-
-
-
Method Detail
-
withCreationScript
public DbCreateTask.DbCreateTaskExecuteStepIfc withCreationScript(java.nio.file.Path pathToScript)
- Specified by:
withCreationScript
in 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:
withTables
in 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:
withExcelData
in 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:
withInserts
in 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:
withConstraints
in 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.DbCreateTaskExecuteStepIfc
Finishes the builder process of building the creation commands- Specified by:
execute
in interfaceDbCreateTask.DbCreateTaskExecuteStepIfc
- Returns:
- an instance of DbCreateCommandList
-
-