Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (


Class PKConstraint

  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.Constraint
              extended by oracle.javatools.db.ColumnConstraint
                  extended by oracle.javatools.db.UniqueConstraint
                      extended by oracle.javatools.db.PKConstraint
All Implemented Interfaces:
ChildDBObject, DBObject, Copyable, DynamicPropertySet

public class PKConstraint
extends UniqueConstraint

A PKConstraint represents a Primary Key constraint. A Primary Key combines a NOT NULL constraint and a unique constraint in a single declaration. That is, it prohibits multiple rows from having the same value in the same column or combination of columns and prohibits values from being null.

Nested Class Summary
Nested classes/interfaces inherited from class oracle.javatools.db.Constraint
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport
Field Summary
static java.lang.String CONSTRAINT_TYPE
Fields inherited from class oracle.javatools.db.Constraint
Fields inherited from interface oracle.javatools.db.DBObject
Constructor Summary
          Constructs a new PKConstraint.
PKConstraint(java.lang.String name, Relation relation)
          Constructs a new PKConstraint on the specified Relation with the specified name.
Method Summary
protected  void addColumnImpl(Column col, Relation relForColumn)
 java.lang.String getConstraintType()
          Retrieves the type of constraint represented by this instance.
static PKConstraint getPrimaryKey(Relation table)
          Returns a primary key for the given table, if it owns one.
Methods inherited from class oracle.javatools.db.UniqueConstraint
getIndexID, isUnique, setIndexID
Methods inherited from class oracle.javatools.db.ColumnConstraint
addColumn, getColumnIDs, getColumns, isConstrained, removeColumn, setColumnIDs, setColumns
Methods inherited from class oracle.javatools.db.Constraint
getConstraints, getDeferrableState, getRelation, getType, isEnabled, setDeferrableState, setEnabled, setRelation
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent, getProperty, setParent, setProperty
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDs, getReferenceIDsImpl, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID, setName
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, setProperties

Field Detail


public static final java.lang.String CONSTRAINT_TYPE
See Also:
Constant Field Values
Constructor Detail


public PKConstraint()
Constructs a new PKConstraint.


public PKConstraint(java.lang.String name,
                    Relation relation)
Constructs a new PKConstraint on the specified Relation with the specified name.

a - string containing the name of the constraint
relation - the relation on which this constraint acts
Method Detail


public java.lang.String getConstraintType()
Description copied from class: Constraint
Retrieves the type of constraint represented by this instance. Valid constraint types can vary depending on the database. Examples of constraint types include primary key constraints, foreign key constraints, and check constraints.

getConstraintType in class UniqueConstraint
a string value indicating the type of constraint.


public static final PKConstraint getPrimaryKey(Relation table)
Returns a primary key for the given table, if it owns one.


protected void addColumnImpl(Column col,
                             Relation relForColumn)
addColumnImpl in class ColumnConstraint

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (


Copyright © 1997, 2011, Oracle. All rights reserved.