Class ModelBuilder
java.lang.Object
net.sf.jailer.modelbuilder.ModelBuilder
Automatically builds a data-model using a list of
ModelElementFinder.
Writes all model elements into the files
- model-builder-table.csv
- model-builder-association.csv
-
-
except the already known elements (table.csv/association.csv)
and the excluded elements listed in exclude-[tables|associations].csv
- Author:
- Ralf Wisser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuild(DataSource dataSource, DBMS dbms, String schema, StringBuffer warnings, ExecutionContext executionContext) Builds the data model and writes generated definitions to CSV files.static voidbuildAndMerge(DataSource dataSource, DBMS dbms, String schema, StringBuffer warnings, ExecutionContext executionContext) Builds and merges the data model.static voidcleanUp(ExecutionContext executionContext) Removes temporary files.static StringgetModelBuilderAssociationsFilename(ExecutionContext executionContext) Gets the name of the CSV file for generated association definitions.static StringgetModelBuilderColumnsFilename(ExecutionContext executionContext) Gets the name of the CSV file for generated column definitions.static StringgetModelBuilderCommentsFilename(ExecutionContext executionContext) Gets the name of the CSV file for generated comments.static StringgetModelBuilderTablesFilename(ExecutionContext executionContext) Gets the name of the CSV file for generated table definitions.static booleanisJailerTable(String table) Checks if a table name refers to one of Jailer's working tables.static voidresetFiles(ExecutionContext executionContext) Resets 'model-builder-*.csv' files.
-
Field Details
-
assocFilter
-
-
Constructor Details
-
ModelBuilder
public ModelBuilder()
-
-
Method Details
-
getModelBuilderTablesFilename
Gets the name of the CSV file for generated table definitions.- Parameters:
executionContext- the execution context- Returns:
- the file name
-
getModelBuilderColumnsFilename
Gets the name of the CSV file for generated column definitions.- Parameters:
executionContext- the execution context- Returns:
- the file name
-
getModelBuilderAssociationsFilename
Gets the name of the CSV file for generated association definitions.- Parameters:
executionContext- the execution context- Returns:
- the file name
-
getModelBuilderCommentsFilename
Gets the name of the CSV file for generated comments.- Parameters:
executionContext- the execution context- Returns:
- the file name
-
buildAndMerge
public static void buildAndMerge(DataSource dataSource, DBMS dbms, String schema, StringBuffer warnings, ExecutionContext executionContext) throws Exception Builds and merges the data model.- Parameters:
dataSource- the data source to analyzedbms- the DBMS configurationschema- the schema to introspectwarnings- string buffer to append warnings into, may benullexecutionContext- the execution context- Throws:
Exception
-
build
public static void build(DataSource dataSource, DBMS dbms, String schema, StringBuffer warnings, ExecutionContext executionContext) throws Exception Builds the data model and writes generated definitions to CSV files.- Parameters:
dataSource- the data source to analyzedbms- the DBMS configurationschema- the schema to introspectwarnings- string buffer to append warnings into, may benullexecutionContext- the execution context- Throws:
Exception
-
isJailerTable
Checks if a table name refers to one of Jailer's working tables.- Parameters:
table- the table name to check- Returns:
trueif the name refers to one of Jailer's working tables
-
resetFiles
Resets 'model-builder-*.csv' files.- Throws:
IOException
-
cleanUp
Removes temporary files.
-