org.hibernate.metamodel.relational
Class PrimaryKey

java.lang.Object
  extended by org.hibernate.metamodel.relational.AbstractConstraint
      extended by org.hibernate.metamodel.relational.PrimaryKey
All Implemented Interfaces:
Constraint, Exportable

public class PrimaryKey
extends AbstractConstraint
implements Constraint, Exportable

Models a table's primary key.

NOTE : This need not be a physical primary key; we just mean a column or columns which uniquely identify rows in the table. Of course it is recommended to define proper integrity constraints, including primary keys.


Constructor Summary
protected PrimaryKey(TableSpecification table)
           
 
Method Summary
 String getExportIdentifier()
          Get a unique identifier to make sure we are not exporting the same database structure multiple times.
 String getName()
          Obtain the constraint name.
 void setName(String name)
           
 String sqlConstraintStringInAlterTable(Dialect dialect)
           
 String sqlConstraintStringInCreateTable(Dialect dialect)
           
 
Methods inherited from class org.hibernate.metamodel.relational.AbstractConstraint
addColumn, getColumns, getColumnSpan, getTable, internalAddColumn, internalColumnAccess, isCreationVetoed, sqlCreateStrings, sqlDropStrings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.metamodel.relational.Constraint
getColumns, getTable
 
Methods inherited from interface org.hibernate.metamodel.relational.Exportable
sqlCreateStrings, sqlDropStrings
 

Constructor Detail

PrimaryKey

protected PrimaryKey(TableSpecification table)
Method Detail

getName

public String getName()
Description copied from interface: Constraint
Obtain the constraint name.

Specified by:
getName in interface Constraint
Overrides:
getName in class AbstractConstraint
Returns:
the name.

setName

public void setName(String name)

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.

Specified by:
getExportIdentifier in interface Exportable
Returns:
The exporting identifier.

sqlConstraintStringInCreateTable

public String sqlConstraintStringInCreateTable(Dialect dialect)

sqlConstraintStringInAlterTable

public String sqlConstraintStringInAlterTable(Dialect dialect)
Specified by:
sqlConstraintStringInAlterTable in class AbstractConstraint


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.