Class PrimaryKeyFactory

java.lang.Object
net.sf.jailer.datamodel.PrimaryKeyFactory

public class PrimaryKeyFactory extends Object
Factory for PrimaryKeys. Builds the universal primary key as a super-set of all created primary key.
Author:
Ralf Wisser
  • Constructor Details

  • Method Details

    • createPrimaryKey

      public PrimaryKey createPrimaryKey(List<Column> columns, String tableName)
      Constructs a new primary-key.
      Parameters:
      columns - the primary-key columns
      tableName - the name of the table owning the primary key
      Returns:
      a newly created primary-key
      Throws:
      IllegalStateException - if factory is closed
    • getUniversalPrimaryKey

      public PrimaryKey getUniversalPrimaryKey(Session session)
      Gets the primary-key to be used for the entity-table and closes the factory.
      Parameters:
      session - for guessing null-values of columns
      Returns:
      the universal primary key
    • createUPKScope

      public static void createUPKScope(String extractionModelFile, ExecutionContext executionContext) throws MalformedURLException, IOException
      Creates a UPK scope by computing the closure of all subject tables in the extraction model and storing the resulting table names in the execution context.
      Parameters:
      extractionModelFile - path to the extraction model file
      executionContext - the execution context to store the UPK domain into
      Throws:
      MalformedURLException - if the extraction model file URL is malformed
      IOException - if an I/O error occurs while reading the extraction model