oracle.javatools.db
Class PKConstraint
java.lang.Object
oracle.javatools.db.AbstractDBObject
oracle.javatools.db.AbstractChildDBObject
oracle.javatools.db.Constraint
oracle.javatools.db.ColumnConstraint
oracle.javatools.db.UniqueConstraint
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.
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. |
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 |
CONSTRAINT_TYPE
public static final java.lang.String CONSTRAINT_TYPE
- See Also:
- Constant Field Values
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 constraintrelation
- the relation on which this constraint acts
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.
addColumnImpl
protected void addColumnImpl(Column col,
Relation relForColumn)
- Overrides:
addColumnImpl
in class ColumnConstraint
Copyright © 1997, 2011, Oracle. All rights reserved.