Skip navigation links
oracle.javatools.db
Class FKConstraint
java.lang.Object
oracle.javatools.db.AbstractDBObject
oracle.javatools.db.AbstractChildDBObject
oracle.javatools.db.Constraint
oracle.javatools.db.ColumnConstraint
oracle.javatools.db.FKConstraint
- All Implemented Interfaces:
- ChildDBObject, DBObject, Copyable, DynamicPropertySet
-
public class FKConstraint
- extends ColumnConstraint
A FKConstraint
represents a Foreign Key Constraint. A foreign key constraint requires values in the constrained table to match values in another table.
An FKConstraint contains a reference to a UniqueConstraint. This referenced constraint determines the valid values for the columns constrained.
Constructor Summary |
FKConstraint()
Constructs a new FKConstraint. |
FKConstraint(java.lang.String name, Relation relation)
Constructs a new FKConstraint with the specified name on the specified relation. |
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
ON_DELETE_RESTRICT
public static final int ON_DELETE_RESTRICT
-
- See Also:
- Constant Field Values
ON_DELETE_CASCADE
public static final int ON_DELETE_CASCADE
-
- See Also:
- Constant Field Values
ON_DELETE_SET_NULL
public static final int ON_DELETE_SET_NULL
-
- See Also:
- Constant Field Values
ON_DELETE_NONE
@Deprecated
public static final int ON_DELETE_NONE
- Deprecated. use ON_DELETE_RESTRICT instead
- See Also:
- Constant Field Values
FKConstraint
public FKConstraint()
- Constructs a new FKConstraint.
FKConstraint
public FKConstraint(java.lang.String name,
Relation relation)
- Constructs a new FKConstraint with the specified name on the specified relation.
- Parameters:
name
- a string containing the name of the constraint
relation
- the relation being constrained.
setIgnorReferencedSchema
@Deprecated
public void setIgnorReferencedSchema(boolean flag)
- Deprecated. with no replacement
isReferencedSchemaIgnored
@Deprecated
public boolean isReferencedSchemaIgnored()
- Deprecated. with no replacement
setReferenceID
public void setReferenceID(DBObjectID id)
- Sets the Object ID of the referenced unique constraint.
-
- Parameters:
id
- The DBObjectID of the referenced constraint
getReferenceID
public DBObjectID getReferenceID()
- Retrieves the Object ID of the referenced unique constraint.
-
- Returns:
- The DBObjectID of the referenced constraint
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.
-
- Specified by:
getConstraintType
in class Constraint
-
- Returns:
- a string value indicating the type of constraint.
getDeleteMode
public int getDeleteMode()
- Whether this constraint specifies
CASCADE DELETE
. A foreign key with cascading delete indicates that the deleting of a value from the parent table should delete all rows in the child table that reference that value.
-
- Returns:
- a boolean value indicating whether this constraint specifies a cascading delete.
setDeleteMode
public void setDeleteMode(int onDelete)
- Sets whether this constraint specifies
CASCADE DELETE
. A foreign key with cascading delete indicates that the deleting of a value from the parent table should delete all rows in the child table that reference that value.
-
- Parameters:
onDelete
- a boolean value indicating whether this constraint specifies a cascading delete.
Skip navigation links
Copyright © 1997, 2015, Oracle. All rights reserved.