Class ModelBuilder

java.lang.Object
net.sf.jailer.modelbuilder.ModelBuilder

public class ModelBuilder extends Object
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 Details

  • Constructor Details

    • ModelBuilder

      public ModelBuilder()
  • Method Details

    • getModelBuilderTablesFilename

      public static String getModelBuilderTablesFilename(ExecutionContext executionContext)
      Gets the name of the CSV file for generated table definitions.
      Parameters:
      executionContext - the execution context
      Returns:
      the file name
    • getModelBuilderColumnsFilename

      public static String getModelBuilderColumnsFilename(ExecutionContext executionContext)
      Gets the name of the CSV file for generated column definitions.
      Parameters:
      executionContext - the execution context
      Returns:
      the file name
    • getModelBuilderAssociationsFilename

      public static String getModelBuilderAssociationsFilename(ExecutionContext executionContext)
      Gets the name of the CSV file for generated association definitions.
      Parameters:
      executionContext - the execution context
      Returns:
      the file name
    • getModelBuilderCommentsFilename

      public static String getModelBuilderCommentsFilename(ExecutionContext executionContext)
      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 analyze
      dbms - the DBMS configuration
      schema - the schema to introspect
      warnings - string buffer to append warnings into, may be null
      executionContext - 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 analyze
      dbms - the DBMS configuration
      schema - the schema to introspect
      warnings - string buffer to append warnings into, may be null
      executionContext - the execution context
      Throws:
      Exception
    • isJailerTable

      public static boolean isJailerTable(String table)
      Checks if a table name refers to one of Jailer's working tables.
      Parameters:
      table - the table name to check
      Returns:
      true if the name refers to one of Jailer's working tables
    • resetFiles

      public static void resetFiles(ExecutionContext executionContext) throws IOException
      Resets 'model-builder-*.csv' files.
      Throws:
      IOException
    • cleanUp

      public static void cleanUp(ExecutionContext executionContext)
      Removes temporary files.