Class ModuleSupportImpl
java.lang.Object
ch.tocco.nice2.dbrefactoring.impl.ModuleSupportImpl
- All Implemented Interfaces:
ModuleSupport
-
Constructor Summary
ConstructorsConstructorDescriptionModuleSupportImpl(org.slf4j.Logger log, ModuleManager moduleManager, IteratorFactory iteratorFactory, Query2Changelog query2Changelog, NiceModelTree niceModelTree, DataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateChangelogResourceOutline(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:ModuleSupportReturns a set of table names currently available at the configured database.- Specified by:
getTableNamesin interfaceModuleSupport
-
generateInitialChangelog
Description copied from interface:ModuleSupportGenerates 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:
generateInitialChangelogin interfaceModuleSupport- Parameters:
moduleName- the modulename- Throws:
DbRefactoringException- on any error
-
generateInitialChangelog
Description copied from interface:ModuleSupportGenerates 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:
generateInitialChangelogin interfaceModuleSupport- Throws:
DbRefactoringException
-
generateInitialValues
Description copied from interface:ModuleSupportGenerates a changelog file that contains all results from the specified query.- Specified by:
generateInitialValuesin interfaceModuleSupport- Parameters:
query- a querylimit- the query limit- Throws:
DbRefactoringException
-
generateInitialValuesFromLookupEntities
public Changelog generateInitialValuesFromLookupEntities(Set<String> moduleSet) throws DbRefactoringException Description copied from interface:ModuleSupportGoes 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:
generateInitialValuesFromLookupEntitiesin interfaceModuleSupport- Throws:
DbRefactoringException
-
createChangelogResourceOutline
Description copied from interface:ModuleSupportGenerates the initial db changelog together with values from lookup entities and stores them in the file system of the module.- Specified by:
createChangelogResourceOutlinein interfaceModuleSupport- Parameters:
overwrite- true to overwrite existing files
-