Package org.hibernate.mapping
Class PrimaryKey
- java.lang.Object
-
- org.hibernate.mapping.Constraint
-
- org.hibernate.mapping.PrimaryKey
-
- All Implemented Interfaces:
Serializable
,Exportable
public class PrimaryKey extends Constraint
A mapping model object representing a primary key constraint.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrimaryKey(Table table)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addColumn(Column column)
String
generatedConstraintNamePrefix()
List<Column>
getColumnsInOriginalOrder()
String
getExportIdentifier()
Get a unique identifier to make sure we are not exporting the same database structure multiple times.UniqueKey
getOrderingUniqueKey()
int[]
getOriginalOrder()
protected String
getTableNameForLogging(Column column)
void
reorderColumns(List<Column> reorderedColumns)
void
setOrderingUniqueKey(UniqueKey uniqueKey)
String
sqlConstraintString(SqlStringGenerationContext context, String constraintName, String defaultCatalog, String defaultSchema)
Deprecated, for removal: This API element is subject to removal in a future version.String
sqlConstraintString(Dialect dialect)
-
Methods inherited from class org.hibernate.mapping.Constraint
addColumns, containsColumn, generateName, generateName, getColumn, getColumns, getColumnSpan, getName, getTable, hashedName, isGenerated, setName, setTable, toString
-
-
-
-
Constructor Detail
-
PrimaryKey
public PrimaryKey(Table table)
-
-
Method Detail
-
addColumn
public void addColumn(Column column)
- Overrides:
addColumn
in classConstraint
-
sqlConstraintString
@Deprecated(since="6.2", forRemoval=true) public String sqlConstraintString(SqlStringGenerationContext context, String constraintName, String defaultCatalog, String defaultSchema)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
sqlConstraintString
in classConstraint
-
generatedConstraintNamePrefix
public String generatedConstraintNamePrefix()
- Specified by:
generatedConstraintNamePrefix
in classConstraint
- Returns:
- String The prefix to use in generated constraint names. Examples: "UK_", "FK_", and "PK_".
-
getExportIdentifier
public String getExportIdentifier()
Description copied from interface:Exportable
Get a unique identifier to make sure we are not exporting the same database structure multiple times.- Returns:
- The exporting identifier.
-
setOrderingUniqueKey
public void setOrderingUniqueKey(UniqueKey uniqueKey)
-
getOrderingUniqueKey
public UniqueKey getOrderingUniqueKey()
-
getOriginalOrder
@Internal public int[] getOriginalOrder()
-
-