Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)


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.AbstractDBObject
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
 DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
          Internal copy method used by the API to perform copy operations.
 boolean equals(java.lang.Object target)
 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
Methods inherited from class oracle.javatools.db.ColumnConstraint
addColumn, copyToImpl, equalsImpl, getColumnIDs, getColumns, getReferenceIDsImpl, isConstrained, removeColumn, replaceReferenceIDs, setColumnIDs, setColumns
Methods inherited from class oracle.javatools.db.Constraint
copyToImpl, equalsImpl, getConstraints, getRelation, getType, isEnabled, setEnabled, setRelation
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent, setParent
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyToImpl, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, setID, setName, setProperties, setProperty, 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, setID, setName
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, getProperty, setProperties, setProperty

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 DBObject copyTo(DBObject target,
                       DBObject copyParent,
                       IDPolicy idPolicy)
Description copied from class: AbstractDBObject
Internal copy method used by the API to perform copy operations. All objects must implement this method if they are instantiable objects. Abstract objects (e.g. Relation) must NOT implement this method. The implementation should delegate to the copyToImpl method to copy the actual properties.

This method does not fix internal reference ids on copy. That is done by the calling DBObject.copyTo(DBObject, IDPolicy) method.

copyTo in class UniqueConstraint
See Also:
DBObject.copyTo(java.lang.Object), DBObject.copyTo(DBObject, boolean), AbstractDBObject.copyToImpl(oracle.javatools.db.AbstractDBObject, oracle.javatools.db.DBObject, oracle.javatools.db.IDPolicy)


public boolean equals(java.lang.Object target)
equals in class UniqueConstraint


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.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)


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