Class PrimaryKey
java.lang.Object
net.sf.jailer.datamodel.PrimaryKey
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReplaces the current primary-key columns with the given list.columnList(String prefix) Creates a comma-separated list of column names.columnList(String prefix, Quoting quoting) Creates a comma-separated list of column names.Gets the primary-key columns.static booleanisAssignable(Column uPKColumn, Column entityColumn) Checks whether a universal primary key column can be assigned to an entity column (i.e.static booleanisIncreasable(Column uPKColumn, Column column) Checks whether a universal primary key column can be increased in size to accommodate the given column.match(PrimaryKey primaryKey) Matches the columns with the columns ofprimaryKeys.t.Returns the primary key in SQL syntax.Returns the primary key in SQL syntax.Returns the primary key in SQL syntax.toString()Returns a string representation of the primary key.
-
Field Details
-
numberOfIndexedPKColumns
public int numberOfIndexedPKColumns
-
-
Constructor Details
-
PrimaryKey
-
-
Method Details
-
getColumns
-
match
Matches the columns with the columns ofprimaryKeys.t. each column ofprimaryKeyis assigned to a column of this PK with same type.- Parameters:
primaryKey- to match- Returns:
- a match of all columns of
primaryKey
-
isAssignable
Checks whether a universal primary key column can be assigned to an entity column (i.e. the UPK column type is compatible with and at least as large as the entity column type).- Parameters:
uPKColumn- the universal primary key columnentityColumn- the entity column to check against- Returns:
trueif the UPK column is assignable to the entity column
-
columnList
-
columnList
-
toSQL
-
toSQL
-
toSQL
Returns the primary key in SQL syntax.- Parameters:
columnPrefix- an optional prefix for each PK-columncontraint- the constraint expression to append after each column definitiontypeReplacement- column type replacements- Returns:
- the primary key definition in SQL syntax
-
toString
-
assign
-
isIncreasable
Checks whether a universal primary key column can be increased in size to accommodate the given column.- Parameters:
uPKColumn- the universal primary key columncolumn- the column whose size requirements must be met- Returns:
trueif the UPK column can be increased to fit the given column
-