public class PrimaryKey
extends java.lang.Object
Table.| Modifier and Type | Field and Description |
|---|---|
int |
numberOfIndexedPKColumns |
| Constructor and Description |
|---|
PrimaryKey(java.util.List<Column> columns,
boolean needsOrderedMatch)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(java.util.List<Column> primaryKeyColumns) |
java.lang.String |
columnList(java.lang.String prefix)
Creates a comma-separated list of column names.
|
java.lang.String |
columnList(java.lang.String prefix,
Quoting quoting)
Creates a comma-separated list of column names.
|
java.util.List<Column> |
getColumns()
Gets the primary-key columns.
|
static boolean |
isAssignable(Column uPKColumn,
Column entityColumn) |
static boolean |
isIncreasable(Column uPKColumn,
Column column) |
java.util.Map<Column,Column> |
match(PrimaryKey primaryKey)
Matches the columns with the columns of
primaryKey
s.t. each column of primaryKey is assigned to a
column of this PK with same type. |
java.lang.String |
toSQL(java.lang.String columnPrefix)
Returns the primary key in SQL syntax.
|
java.lang.String |
toSQL(java.lang.String columnPrefix,
boolean withContraints)
Returns the primary key in SQL syntax.
|
java.lang.String |
toSQL(java.lang.String columnPrefix,
java.lang.String contraint,
java.util.Map<java.lang.String,java.lang.String> typeReplacement)
Returns the primary key in SQL syntax.
|
java.lang.String |
toString()
Returns a string representation of the primary key.
|
public PrimaryKey(java.util.List<Column> columns, boolean needsOrderedMatch)
columns - the primary-key columnsneedsOrderedMatch - true if match with UPK must be orderedpublic java.util.List<Column> getColumns()
public java.util.Map<Column,Column> match(PrimaryKey primaryKey)
primaryKey
s.t. each column of primaryKey is assigned to a
column of this PK with same type.primaryKey - to matchprimaryKeypublic java.lang.String columnList(java.lang.String prefix)
prefix - an optional prefix for each PK-columnpublic java.lang.String columnList(java.lang.String prefix,
Quoting quoting)
prefix - an optional prefix for each PK-columnpublic java.lang.String toSQL(java.lang.String columnPrefix)
columnPrefix - an optional prefix for each PK-columnpublic java.lang.String toSQL(java.lang.String columnPrefix,
boolean withContraints)
columnPrefix - an optional prefix for each PK-columnpublic java.lang.String toSQL(java.lang.String columnPrefix,
java.lang.String contraint,
java.util.Map<java.lang.String,java.lang.String> typeReplacement)
columnPrefix - an optional prefix for each PK-columntypeReplacement - column types replacementspublic java.lang.String toString()
toString in class java.lang.Objectpublic void assign(java.util.List<Column> primaryKeyColumns)