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

E13403-03

oracle.javatools.db
Class PKConstraint

java.lang.Object
  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
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String CONSTRAINT_TYPE
           
 
Fields inherited from class oracle.javatools.db.Constraint
TYPE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
PKConstraint()
          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
isUnique
 
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

CONSTRAINT_TYPE

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

PKConstraint

public PKConstraint()
Constructs a new PKConstraint.


PKConstraint

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

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

copyTo

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.

Overrides:
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)

equals

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

getConstraintType

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.

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

getPrimaryKey

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)

E13403-03

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