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

E13403-05

oracle.javatools.db
Class FKConstraint

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.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.


Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String CONSTRAINT_TYPE
           
static int ON_DELETE_CASCADE
           
static int ON_DELETE_NONE
          Deprecated. use ON_DELETE_RESTRICT instead
static int ON_DELETE_RESTRICT
           
static int ON_DELETE_SET_NULL
           
 
Fields inherited from class oracle.javatools.db.Constraint
TYPE
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
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.
 
Method Summary
 java.lang.String getConstraintType()
          Retrieves the type of constraint represented by this instance.
 int getDeleteMode()
          Whether this constraint specifies CASCADE DELETE.
 DBObjectID getReferenceID()
          Retrieves the Object ID of the referenced unique constraint.
 boolean isReferencedSchemaIgnored()
          Deprecated. with no replacement
 void setDeleteMode(int onDelete)
          Sets whether this constraint specifies CASCADE DELETE.
 void setIgnorReferencedSchema(boolean flag)
          Deprecated. with no replacement
 void setReferenceID(DBObjectID id)
          Sets the Object ID of the referenced unique constraint.
 
Methods inherited from class oracle.javatools.db.ColumnConstraint
addColumn, getColumnIDs, getColumns, isConstrained, removeColumn, setColumnIDs, setColumns
 
Methods inherited from class oracle.javatools.db.Constraint
getConstraints, getRelation, getType, isEnabled, 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

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
Constructor Detail

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.
Method Detail

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.

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

E13403-05

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