Class PrimaryKeyFactory
java.lang.Object
net.sf.jailer.datamodel.PrimaryKeyFactory
Factory for
PrimaryKeys. Builds the universal primary key as a
super-set of all created primary key.- Author:
- Ralf Wisser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePrimaryKey(List<Column> columns, String tableName) Constructs a new primary-key.static voidcreateUPKScope(String extractionModelFile, ExecutionContext executionContext) 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.getUniversalPrimaryKey(Session session) Gets the primary-key to be used for the entity-table and closes the factory.
-
Constructor Details
-
PrimaryKeyFactory
Constructor.- Parameters:
executionContext-ExecutionContext(optional)
-
-
Method Details
-
createPrimaryKey
Constructs a new primary-key.- Parameters:
columns- the primary-key columnstableName- the name of the table owning the primary key- Returns:
- a newly created primary-key
- Throws:
IllegalStateException- if factory is closed
-
getUniversalPrimaryKey
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 fileexecutionContext- the execution context to store the UPK domain into- Throws:
MalformedURLException- if the extraction model file URL is malformedIOException- if an I/O error occurs while reading the extraction model
-