Extension SDK 9.0.5

oracle.jdeveloper.cm.ds.db
Class FKConstraint

java.lang.Object
  extended byoracle.jdeveloper.cm.ds.db.AbstractDBObject
      extended byoracle.jdeveloper.cm.ds.db.Constraint
          extended byoracle.jdeveloper.cm.ds.db.ColumnConstraint
              extended byoracle.jdeveloper.cm.ds.db.FKConstraint
All Implemented Interfaces:
Copyable, DBObject, Subject

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.


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.jdeveloper.cm.ds.db.Constraint
TYPE
 
Fields inherited from interface oracle.jdeveloper.cm.ds.db.DBObject
COMMENT
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
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
 void addReferencedColumnName(java.lang.String colName)
          Deprecated.  
 java.lang.Object copyTo(java.lang.Object target)
          Copies the state of this DBObject to another instance.
protected  void copyToImpl(FKConstraint copy)
           
 boolean equals(java.lang.Object target)
           
protected  boolean equalsImpl(FKConstraint target)
           
 java.lang.String getConstraintType()
          Retrieves the type of constraint represented by this instance.
 int getDeleteMode()
          Whether this constraint specifies CASCADE DELETE.
 java.lang.String[] getReferencedColumnNames()
          Deprecated.  
 java.lang.String getReferencedName()
          Deprecated.  
 java.lang.String getReferencedRelation()
          Deprecated.  
 Schema getReferencedSchema()
          Deprecated.  
 DBObjectID getReferenceID()
          Retrieves the Object ID of the referenced unique constraint.
 boolean isReferencedSchemaIgnored()
          Should the generated DDL mention the referenced Schema
 void removeReferencedColumnName(java.lang.String colName)
          Deprecated.  
 void setDeleteMode(int onDelete)
          Sets whether this constraint specifies CASCADE DELETE.
 void setIgnorReferencedSchema(boolean flag)
          Flag that the generated DDL must not to mention the referenced Schema
 void setReferencedColumnNames(java.lang.String[] refColumnNames)
          Deprecated.  
 void setReferencedName(java.lang.String refName)
          Deprecated.  
 void setReferencedRelation(java.lang.String ref)
          Deprecated.  
 void setReferencedSchema(Schema refSchema)
          Deprecated.  
 void setReferenceID(DBObjectID id)
          Sets the Object ID of the referenced unique constraint.
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.ColumnConstraint
addColumn, copyToImpl, equalsImpl, getColumns, removeColumn, setColumns, setRelation
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.Constraint
copyToImpl, equalsImpl, getRelation, getType, isEnabled, setEnabled
 
Methods inherited from class oracle.jdeveloper.cm.ds.db.AbstractDBObject
attach, compareToImpl, copyToImpl, detach, equalsImpl, getID, getName, getProperties, getProperty, hashCode, notifyObservers, setID, setName, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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

public static final int ON_DELETE_NONE
Deprecated. use ON_DELETE_RESTRICT instead

See Also:
Constant Field Values

CONSTRAINT_TYPE

public static final java.lang.String CONSTRAINT_TYPE
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

copyTo

public java.lang.Object copyTo(java.lang.Object target)
Description copied from interface: DBObject
Copies the state of this DBObject to another instance. If null is specified for the target, a new instance will be created.

The entire state of the object will be copied, with a few exceptions. In particular, any observers registered will NOT be copied. In cases where this instance contains child DBObjects, new instances of those children will be created, and the state copied to them. The copy will thus contain its own unique state; after making the copy, changing one instance will not cause any changes to occur to the copy. The properties will be copied; however, copies will not be made of the values referenced by the properties - thus, the copy will refer to the same instance as the original. Child objects that are copied will still point to the original parent; it is the responsibility of a copied parent to update the parent of copies of its children point to the copy of itself.

The ID associated with this object will not be copied. If the copy is intended to be a temporary copy of this object (to be used in a dialog editing the object for example), then the caller should explicitly set the ID of the copy to be the same as on this object. However, if the new object is intended to exist separately from this object, the caller should ensure that the new object have a different ID from this object.

Parameters:
target - The object to copy to. If target is null, a new instance will be created, and the state will be copied to that object.
Returns:
the copy.

equals

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

copyToImpl

protected void copyToImpl(FKConstraint copy)

equalsImpl

protected boolean equalsImpl(FKConstraint target)

setReferencedSchema

public void setReferencedSchema(Schema refSchema)
Deprecated.  

Sets the schema containing the relation on which the referenced constraint exists.

Parameters:
refSchema - a string containing the referenced schema

getReferencedSchema

public Schema getReferencedSchema()
Deprecated.  

Retrieves the schema containing the relation on which the referenced constraint exists.

Returns:
a string containing the referenced schema

setIgnorReferencedSchema

public void setIgnorReferencedSchema(boolean flag)
Flag that the generated DDL must not to mention the referenced Schema


isReferencedSchemaIgnored

public boolean isReferencedSchemaIgnored()
Should the generated DDL mention the referenced Schema


setReferencedRelation

public void setReferencedRelation(java.lang.String ref)
Deprecated.  

Sets the the name of the relation on which the referenced constraint exists.

Parameters:
ref - a string containing the name of the referenced relation

getReferencedRelation

public java.lang.String getReferencedRelation()
Deprecated.  

Retrieves the the name of the relation on which the referenced constraint exists.

Returns:
a string containing the name of the referenced relation

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

setReferencedName

public void setReferencedName(java.lang.String refName)
Deprecated.  

Sets the the name of the referenced constraint.

Parameters:
refName - a string containing the name of the referenced constraint

getReferencedName

public java.lang.String getReferencedName()
Deprecated.  

Retrieves the the name of the referenced constraint.

Returns:
a string containing the name of the referenced constraint

setReferencedColumnNames

public void setReferencedColumnNames(java.lang.String[] refColumnNames)
Deprecated.  

Sets the list of columns referenced by this foreign key constraint.

Parameters:
refColumnNames - the array of referenced column names

getReferencedColumnNames

public java.lang.String[] getReferencedColumnNames()
Deprecated.  

Retrieves the list of columns referenced by this foreign key constraint.

Returns:
the array of referenced column names

addReferencedColumnName

public void addReferencedColumnName(java.lang.String colName)
Deprecated.  

Adds a name to the list of referenced columns.

Parameters:
colName - the name of the referenced column

removeReferencedColumnName

public void removeReferencedColumnName(java.lang.String colName)
Deprecated.  

Removes a name from the list of referenced columns.

Parameters:
colName - the name of the referenced column

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.

Extension SDK

 

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