Class ModuleSupportImpl
java.lang.Object
ch.tocco.nice2.dbrefactoring.impl.ModuleSupportImpl
- All Implemented Interfaces:
ModuleSupport
-
Constructor Summary
ConstructorDescriptionModuleSupportImpl
(org.slf4j.Logger log, ModuleManager moduleManager, IteratorFactory iteratorFactory, Query2Changelog query2Changelog, NiceModelTree niceModelTree, DataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createChangelogResourceOutline
(String moduleName, boolean overwrite) Generates the initial db changelog together with values from lookup entities and stores them in the file system of the module.Generates one changelog that represents the current state of the application.generateInitialChangelog
(String moduleName) Generates an initial changelog file for the specified module.generateInitialValues
(String query, int limit) Generates a changelog file that contains all results from the specified query.generateInitialValuesFromLookupEntities
(Set<String> moduleSet) Goes through all entities of type "lookup" of the given module and creates a changelog with inserts of the values that are obtained from the current connection.Returns a set of table names currently available at the configured database.
-
Constructor Details
-
ModuleSupportImpl
public ModuleSupportImpl(org.slf4j.Logger log, ModuleManager moduleManager, IteratorFactory iteratorFactory, Query2Changelog query2Changelog, NiceModelTree niceModelTree, DataSource dataSource)
-
-
Method Details
-
getTableNames
Description copied from interface:ModuleSupport
Returns a set of table names currently available at the configured database.- Specified by:
getTableNames
in interfaceModuleSupport
-
generateInitialChangelog
Description copied from interface:ModuleSupport
Generates an initial changelog file for the specified module.
Visits all entity models defined in the specified module and generates a db changelog file from this information.
- Specified by:
generateInitialChangelog
in interfaceModuleSupport
- Parameters:
moduleName
- the modulename- Throws:
DbRefactoringException
- on any error
-
generateInitialChangelog
Description copied from interface:ModuleSupport
Generates one changelog that represents the current state of the application. Note, that this changelog is one big file, which is not splittet around the modules, but rather represents the current state of all modules together.- Specified by:
generateInitialChangelog
in interfaceModuleSupport
- Throws:
DbRefactoringException
-
generateInitialValues
Description copied from interface:ModuleSupport
Generates a changelog file that contains all results from the specified query.- Specified by:
generateInitialValues
in interfaceModuleSupport
- Parameters:
query
- a querylimit
- the query limit- Throws:
DbRefactoringException
-
generateInitialValuesFromLookupEntities
public Changelog generateInitialValuesFromLookupEntities(Set<String> moduleSet) throws DbRefactoringException Description copied from interface:ModuleSupport
Goes through all entities of type "lookup" of the given module and creates a changelog with inserts of the values that are obtained from the current connection.- Specified by:
generateInitialValuesFromLookupEntities
in interfaceModuleSupport
- Throws:
DbRefactoringException
-
createChangelogResourceOutline
Description copied from interface:ModuleSupport
Generates the initial db changelog together with values from lookup entities and stores them in the file system of the module.- Specified by:
createChangelogResourceOutline
in interfaceModuleSupport
- Parameters:
overwrite
- true to overwrite existing files
-