Class ExecutionContext
java.lang.Object
net.sf.jailer.ExecutionContext
Execution context of import-/export commands.
- Author:
- Ralf Wisser
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ExecutionContext(CommandLine commandLine) Creates new context with attributes taken fromExecutionContext.ExecutionContext(ExecutionContext other) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanIftrue, Look for aliases while analysing the DBbooleanIftrue, Look for synonyms while analysing the DBbooleanIftrue, Look for views while analysing the DBGets the alias of the current connection.Gets folder of current data model.Gets folder holding the data model.Gets URL of the current data model (the datamodel's base folder)Gets schema map for the deletion script.Gets schema in which the import-filter mapping tables will be createdGets IsolationLevel.Gets the layout storage.getLimit()booleanIftrue, The exported rows will not be sorted according to foreign key constraintsintGets maximum number of entities per insert-statement (in export-file, default is 10)intGets number of threads (default is 1)booleanIftrue, the exported rows will be ordered according to the primary key.Gets parametersGets theProgressListenerRegistry.Gets fully qualified folder name of current data model.booleanIftrue, Add schema prefix to table names after analysing the DBGets schema map for destination database.getSchemaMapping(String rawschemamapping) Parses a raw schema mapping string (comma-separated "from=to" pairs) into a map.getScope()Gets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASEGets the script format.Gets schema map for source database.Gets target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2booleanIftrue, Import rows in a single transactionGets the universal primary key domain.booleanIftrue, Generate 'upsert'-statements for all entities (in export-file)booleanIftrue, use rowid/ctid-column to determine row identity (instead of primary keys)booleanIftrue, use rowid/ctid-column only for tables without primary key.booleangetUTF8()Iftrue, Use UTF-8 encodingGets schema in which the working tables will be createdGets pattern for dates in XML and LIQUIBASE_XML export fileGets root tag of XML export fileGets pattern for times in XML and LIQUIBASE_XML export fileGets pattern for time-stamps in XML and LIQUIBASE_XML export filebooleanbooleanbooleanIs the subsetter embedded into an application?booleanbooleanbooleanCreate working tables that are independent of the extraction model.booleanIftrue, collects the rows using multiple insert operations with a limited number of rows per operation.booleanbooleanvoidsetAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency) voidsetAddGoBatchSeparator(boolean addGoBatchSeparator) voidsetAnalyseAlias(boolean analyseAlias) Iftrue, Look for aliases while analysing the DBvoidsetAnalyseSynonym(boolean analyseSynonym) Iftrue, Look for synonyms while analysing the DBvoidsetAnalyseView(boolean analyseView) Iftrue, Look for views while analysing the DBvoidsetCurrentConnectionAlias(String currentConnectionAlias) Sets the alias of the current connection.voidsetCurrentModelSubfolder(String modelFolder) Sets folder of current data model.voidsetDatamodelFolder(String datamodelFolder) Sets folder holding the data model.voidsetDataModelURL(URL datamodelURL) Sets URL of the current data model (the datamodel's base folder)voidsetDeletionSchemaMapping(Map<String, String> deletionSchemaMapping) Sets schema map for the deletion script.voidsetDisallowNonAggregated(boolean disallowNonAggregated) voidsetEmbedded(boolean embedded) Sets whether the subsetter is embedded into an application.voidsetIgnoreNonAggregated(boolean ignoreNonAggregated) voidsetImportFilterMappingTableSchema(String importFilterMappingTableSchema) Sets schema in which the import-filter mapping tables will be createdvoidsetIncludeNonAggregated(boolean includeNonAggregated) voidsetIndependentWorkingTables(boolean independentWorkingTables) Create working tables that are independent of the extraction model.voidsetInsertIncrementally(boolean insertIncrementally) Iftrue, collects the rows using multiple insert operations with a limited number of rows per operation.voidsetIsolationLevel(Integer isolationLevel) Sets IsolationLevel.voidsetLayoutStorage(LayoutStorage layoutStorage) Sets the layout storage.voidvoidsetLocalDatabaseStorage(String localDatabaseStorage) Sets the folder where the local database will be stored.voidsetNoSorting(boolean noSorting) Iftrue, The exported rows will not be sorted according to foreign key constraintsvoidsetNumberOfEntities(int numberOfEntities) Sets maximum number of entities per insert-statement (in export-file, default is 10)voidsetNumberOfThreads(int numberOfThreads) Sets number of threads (default is 1)voidsetOrderByPK(boolean orderByPK) voidsetParameter(String name, String value) Sets a parameter.voidsetProgressListenerRegistry(ProgressListenerRegistry progressListenerRegistry) Sets theProgressListenerRegistry.voidsetQualifyNames(boolean qualifyNames) Iftrue, Add schema prefix to table names after analysing the DBvoidsetSchemaMapping(Map<String, String> schemaMapping) Sets schema map for destination database.voidsetScope(WorkingTableScope scope) Sets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASEvoidsetScriptFormat(ScriptFormat scriptFormat) Sets the script format.voidsetSingleRoot(boolean singleRoot) voidsetSourceSchemaMapping(Map<String, String> sourceSchemaMapping) Sets schema map for source database.voidsetTargetDBMS(DBMS targetDBMS) Sets target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2voidsetTransactional(boolean transactional) Iftrue, Import rows in a single transactionvoidsetUnformatted(boolean unformatted) voidsetUpkDomain(Set<String> upkDomain) Sets the universal primary key domain.voidsetUpsertOnly(boolean upsertOnly) Iftrue, Generate 'upsert'-statements for all entities (in export-file)voidsetUseRowid(boolean useRowid) Iftrue, use rowid/ctid-column to determine row identity (instead of primary keys)voidsetUseRowIdsOnlyForTablesWithoutPK(boolean useRowIdsOnlyForTablesWithoutPK) Iftrue, use rowid/ctid-column only for tables without primary key.voidsetUTF8(boolean uTF8) Iftrue, Use UTF-8 encodingvoidsetWorkingTableSchema(String workingTableSchema) Sets schema in which the working tables will be createdvoidsetXmlDatePattern(String xmlDatePattern) Sets pattern for dates in XML and LIQUIBASE_XML export filevoidsetXmlRootTag(String xmlRootTag) Sets root tag of XML export filevoidsetXmlTimePattern(String xmlTimePattern) Sets pattern for times in XML and LIQUIBASE_XML export filevoidsetXmlTimeStampPattern(String xmlTimeStampPattern) Sets pattern for time-stamps in XML and LIQUIBASE_XML export file
-
Field Details
-
defaultDatamodelFolder
-
-
Constructor Details
-
ExecutionContext
public ExecutionContext()Default constructor. -
ExecutionContext
Copy constructor. -
ExecutionContext
Creates new context with attributes taken fromExecutionContext.- Parameters:
commandLine- the command line
-
-
Method Details
-
getUTF8
public boolean getUTF8()Iftrue, Use UTF-8 encoding- Returns:
trueif Use UTF-8 encoding
-
setUTF8
public void setUTF8(boolean uTF8) Iftrue, Use UTF-8 encoding- Parameters:
uTF8-trueif Use UTF-8 encoding
-
getTargetDBMS
Gets target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2- Returns:
- target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2
-
setTargetDBMS
Sets target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2- Parameters:
targetDBMS- target-DBMS: ORACLE, MSSQL, DB2, MySQL, POSTGRESQL, SYBASE, SQLITE, HSQL or H2
-
getXmlRootTag
-
setXmlRootTag
Sets root tag of XML export file- Parameters:
xmlRootTag- root tag of XML export file
-
getXmlDatePattern
Gets pattern for dates in XML and LIQUIBASE_XML export file- Returns:
- pattern for dates in XML and LIQUIBASE_XML export file
-
setXmlDatePattern
Sets pattern for dates in XML and LIQUIBASE_XML export file- Parameters:
xmlDatePattern- pattern for dates in XML and LIQUIBASE_XML export file
-
getXmlTimePattern
Gets pattern for times in XML and LIQUIBASE_XML export file- Returns:
- pattern for times in XML and LIQUIBASE_XML export file
-
setXmlTimePattern
Sets pattern for times in XML and LIQUIBASE_XML export file- Parameters:
xmlTimePattern- pattern for times in XML and LIQUIBASE_XML export file
-
getXmlTimeStampPattern
Gets pattern for time-stamps in XML and LIQUIBASE_XML export file- Returns:
- pattern for time-stamps in XML and LIQUIBASE_XML export file
-
setXmlTimeStampPattern
Sets pattern for time-stamps in XML and LIQUIBASE_XML export file- Parameters:
xmlTimeStampPattern- pattern for time-stamps in XML and LIQUIBASE_XML export file
-
getQualifyNames
public boolean getQualifyNames()Iftrue, Add schema prefix to table names after analysing the DB- Returns:
trueif Add schema prefix to table names after analysing the DB
-
setQualifyNames
public void setQualifyNames(boolean qualifyNames) Iftrue, Add schema prefix to table names after analysing the DB- Parameters:
qualifyNames-trueif Add schema prefix to table names after analysing the DB
-
getAnalyseAlias
public boolean getAnalyseAlias()Iftrue, Look for aliases while analysing the DB- Returns:
trueif Look for aliases while analysing the DB
-
setAnalyseAlias
public void setAnalyseAlias(boolean analyseAlias) Iftrue, Look for aliases while analysing the DB- Parameters:
analyseAlias-trueif Look for aliases while analysing the DB
-
getAnalyseSynonym
public boolean getAnalyseSynonym()Iftrue, Look for synonyms while analysing the DB- Returns:
trueif Look for synonyms while analysing the DB
-
setAnalyseSynonym
public void setAnalyseSynonym(boolean analyseSynonym) Iftrue, Look for synonyms while analysing the DB- Parameters:
analyseSynonym-trueif Look for synonyms while analysing the DB
-
getAnalyseView
public boolean getAnalyseView()Iftrue, Look for views while analysing the DB- Returns:
trueif Look for views while analysing the DB
-
setAnalyseView
public void setAnalyseView(boolean analyseView) Iftrue, Look for views while analysing the DB- Parameters:
analyseView-trueif Look for views while analysing the DB
-
getNumberOfThreads
public int getNumberOfThreads()Gets number of threads (default is 1)- Returns:
- number of threads (default is 1)
-
setNumberOfThreads
public void setNumberOfThreads(int numberOfThreads) Sets number of threads (default is 1)- Parameters:
numberOfThreads- number of threads (default is 1)
-
getNumberOfEntities
public int getNumberOfEntities()Gets maximum number of entities per insert-statement (in export-file, default is 10)- Returns:
- maximum number of entities per insert-statement (in export-file, default is 10)
-
setNumberOfEntities
public void setNumberOfEntities(int numberOfEntities) Sets maximum number of entities per insert-statement (in export-file, default is 10)- Parameters:
numberOfEntities- maximum number of entities per insert-statement (in export-file, default is 10)
-
getUpsertOnly
public boolean getUpsertOnly()Iftrue, Generate 'upsert'-statements for all entities (in export-file)- Returns:
trueif Generate 'upsert'-statements for all entities (in export-file)
-
setUpsertOnly
public void setUpsertOnly(boolean upsertOnly) Iftrue, Generate 'upsert'-statements for all entities (in export-file)- Parameters:
upsertOnly-trueif Generate 'upsert'-statements for all entities (in export-file)
-
getScope
Gets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE- Returns:
- scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE
-
setScope
Sets scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE- Parameters:
scope- scope of working tables, GLOBAL, SESSION_LOCAL or LOCAL_DATABASE
-
getWorkingTableSchema
Gets schema in which the working tables will be created- Returns:
- schema in which the working tables will be created
-
setWorkingTableSchema
Sets schema in which the working tables will be created- Parameters:
workingTableSchema- schema in which the working tables will be created
-
getDatamodelFolder
Gets folder holding the data model. Defaults to './datamodel'- Returns:
- folder holding the data model. Defaults to './datamodel'
-
setDatamodelFolder
Sets folder holding the data model. Defaults to './datamodel'- Parameters:
datamodelFolder- folder holding the data model. Defaults to './datamodel'
-
getQualifiedDatamodelFolder
Gets fully qualified folder name of current data model. -
getNoSorting
public boolean getNoSorting()Iftrue, The exported rows will not be sorted according to foreign key constraints- Returns:
trueif The exported rows will not be sorted according to foreign key constraints
-
setNoSorting
public void setNoSorting(boolean noSorting) Iftrue, The exported rows will not be sorted according to foreign key constraints- Parameters:
noSorting-trueif The exported rows will not be sorted according to foreign key constraints
-
getOrderByPK
public boolean getOrderByPK()Iftrue, the exported rows will be ordered according to the primary key. -
setOrderByPK
public void setOrderByPK(boolean orderByPK) - Parameters:
orderByPK- iftrue, the exported rows will be ordered according to the primary key
-
getTransactional
public boolean getTransactional()Iftrue, Import rows in a single transaction- Returns:
trueif Import rows in a single transaction
-
setTransactional
public void setTransactional(boolean transactional) Iftrue, Import rows in a single transaction- Parameters:
transactional-trueif Import rows in a single transaction
-
getIsolationLevel
-
setIsolationLevel
-
getUseRowid
public boolean getUseRowid()Iftrue, use rowid/ctid-column to determine row identity (instead of primary keys)- Returns:
- if
trueuse rowid/ctid-column to determine row identity (instead of primary keys)
-
setUseRowid
public void setUseRowid(boolean useRowid) Iftrue, use rowid/ctid-column to determine row identity (instead of primary keys)- Parameters:
useRowid- iftrueuse rowid/ctid-column to determine row identity (instead of primary keys)
-
getUseRowIdsOnlyForTablesWithoutPK
public boolean getUseRowIdsOnlyForTablesWithoutPK()Iftrue, use rowid/ctid-column only for tables without primary key.- Returns:
- if
trueuse rowid/ctid-column only for tables without primary key
-
setUseRowIdsOnlyForTablesWithoutPK
public void setUseRowIdsOnlyForTablesWithoutPK(boolean useRowIdsOnlyForTablesWithoutPK) Iftrue, use rowid/ctid-column only for tables without primary key.- Parameters:
useRowIdsOnlyForTablesWithoutPK- iftrueuse rowid/ctid-column only for tables without primary key
-
getAddGoBatchSeparator
public boolean getAddGoBatchSeparator()- Returns:
- if
true, insert "GO" batch terminators into generated script (Microsoft SQL Server / Sybase).
-
setAddGoBatchSeparator
public void setAddGoBatchSeparator(boolean addGoBatchSeparator) - Parameters:
addGoBatchSeparator- iftrueinsert "GO" batch terminators into generated script (Microsoft SQL Server / Sybase)
-
getImportFilterMappingTableSchema
Gets schema in which the import-filter mapping tables will be created- Returns:
- schema in which the import-filter mapping tables will be created
-
setImportFilterMappingTableSchema
Sets schema in which the import-filter mapping tables will be created- Parameters:
importFilterMappingTableSchema- schema in which the import-filter mapping tables will be created
-
isInsertIncrementally
public boolean isInsertIncrementally()Iftrue, collects the rows using multiple insert operations with a limited number of rows per operation.
Use this option if otherwise the transactions become too big. -
setInsertIncrementally
public void setInsertIncrementally(boolean insertIncrementally) Iftrue, collects the rows using multiple insert operations with a limited number of rows per operation.
Use this option if otherwise the transactions become too big. -
isAbortInCaseOfInconsistency
public boolean isAbortInCaseOfInconsistency()- Returns:
- if
true,Subsetter.execute(String, File)throws anInconsistentSubsettingResultExceptionif the result is inconsistent due to insufficient transaction isolation
-
setAbortInCaseOfInconsistency
public void setAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency) - Parameters:
abortInCaseOfInconsitency- iftrue,Subsetter.execute(String, File)throws anInconsistentSubsettingResultExceptionif the result is inconsistent due to insufficient transaction isolation
-
isEmbedded
public boolean isEmbedded()Is the subsetter embedded into an application?- Returns:
trueif the subsetter is embedded into an application
-
setEmbedded
public void setEmbedded(boolean embedded) Sets whether the subsetter is embedded into an application.- Parameters:
embedded-trueif the subsetter is embedded into an application
-
getParameters
-
setParameter
-
getSchemaMapping
-
getSchemaMapping
-
setSchemaMapping
-
setSourceSchemaMapping
-
getSourceSchemaMapping
-
setDeletionSchemaMapping
-
getDeletionSchemaMapping
-
getScriptFormat
-
setScriptFormat
Sets the script format.- Parameters:
scriptFormat- the script format
-
setCurrentModelSubfolder
Sets folder of current data model.- Parameters:
modelFolder- the folder,nullfor default model
-
getCurrentModelSubfolder
Gets folder of current data model.- Returns:
- modelFolder the folder,
nullfor default model
-
getDataModelURL
Gets URL of the current data model (the datamodel's base folder)- Returns:
- URL of the current data model (the datamodel's base folder)
-
setDataModelURL
Sets URL of the current data model (the datamodel's base folder)- Parameters:
datamodelURL- URL of the data model base folder
-
isUnformatted
public boolean isUnformatted()- Returns:
true: don't format JSON/YAML/XML export files
-
setUnformatted
public void setUnformatted(boolean unformatted) - Parameters:
unformatted-true: don't format JSON/YAML/XML export files
-
isSingleRoot
public boolean isSingleRoot()- Returns:
- allow only a single root/subject object to be written out into JSON/YAML/XML export file
-
setSingleRoot
public void setSingleRoot(boolean singleRoot) - Parameters:
singleRoot- allow only a single root/subject object to be written out into JSON/YAML/XML export file
-
isDisallowNonAggregated
public boolean isDisallowNonAggregated()- Returns:
- if
true, raise an error if there are objects not aggregated into any other object in JSON/YAML/XML export file
-
setDisallowNonAggregated
public void setDisallowNonAggregated(boolean disallowNonAggregated) - Parameters:
disallowNonAggregated- iftrue, raise an error if there are objects not aggregated into any other object in JSON/YAML/XML export file
-
isIncludeNonAggregated
public boolean isIncludeNonAggregated()- Returns:
- write out all objects that are not aggregated in any other object at root level into JSON/YAML/XML export file
-
setIncludeNonAggregated
public void setIncludeNonAggregated(boolean includeNonAggregated) - Parameters:
includeNonAggregated- write out all objects that are not aggregated in any other object at root level into JSON/YAML/XML export file
-
isIgnoreNonAggregated
public boolean isIgnoreNonAggregated()- Returns:
- don't write out any object that are not aggregated in any other object into JSON/YAML/XML export file
-
setIgnoreNonAggregated
public void setIgnoreNonAggregated(boolean ignoreNonAggregated) - Parameters:
ignoreNonAggregated- don't write out any object that are not aggregated in any other object into JSON/YAML/XML export file
-
getProgressListenerRegistry
Gets theProgressListenerRegistry.- Returns:
- the
ProgressListenerRegistry
-
setProgressListenerRegistry
Sets theProgressListenerRegistry.- Parameters:
progressListenerRegistry- theProgressListenerRegistry
-
getLayoutStorage
-
setLayoutStorage
Sets the layout storage.- Parameters:
layoutStorage- the layout storage
-
getLimit
- Returns:
- maximum allowed number of exported rows. If this limit is exceeded, the export aborts with an error.
-
setLimit
- Parameters:
limit- maximum allowed number of exported rows. If this limit is exceeded, the export aborts with an error.
-
isIndependentWorkingTables
public boolean isIndependentWorkingTables()Create working tables that are independent of the extraction model. (Potentially less efficient) -
setIndependentWorkingTables
public void setIndependentWorkingTables(boolean independentWorkingTables) Create working tables that are independent of the extraction model. (Potentially less efficient) -
getUpkDomain
-
setUpkDomain
-
getCurrentConnectionAlias
Gets the alias of the current connection.- Returns:
- the current connection alias
-
setCurrentConnectionAlias
Sets the alias of the current connection.- Parameters:
currentConnectionAlias- the current connection alias
-
getLocalDatabaseStorage
- Returns:
- the folder where the local database will be stored. If
null, default temp folder is used.
-
setLocalDatabaseStorage
Sets the folder where the local database will be stored.- Parameters:
localDatabaseStorage- the folder where the local database will be stored. Ifnull, default temp folder is used.
-