|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.db.AbstractDBObject oracle.javatools.db.AbstractChildDBObject oracle.javatools.db.Constraint oracle.javatools.db.ColumnConstraint oracle.javatools.db.FKConstraint
public class FKConstraint
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 | |
---|---|
DBObject |
copyTo(DBObject target,
DBObject copyParent,
IDPolicy idPolicy)
Internal copy method used by the API to perform copy operations. |
protected void |
copyToImpl(FKConstraint copy,
Relation copyParent,
IDPolicy idPolicy)
|
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 . |
DBObjectID |
getReferenceID()
Retrieves the Object ID of the referenced unique constraint. |
protected void |
getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
Used by the final getReferenceID() implementation. |
boolean |
isReferencedSchemaIgnored()
Should the generated DDL mention the referenced Schema |
boolean |
replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
Override in subclasses to replace reference IDs as appropriate. |
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 |
setReferenceID(DBObjectID id)
Sets the Object ID of the referenced unique constraint. |
Methods inherited from class oracle.javatools.db.ColumnConstraint |
---|
addColumn, copyToImpl, equalsImpl, getColumnIDs, getColumns, isConstrained, removeColumn, 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 |
---|
public static final java.lang.String CONSTRAINT_TYPE
public static final int ON_DELETE_RESTRICT
public static final int ON_DELETE_CASCADE
public static final int ON_DELETE_SET_NULL
@Deprecated public static final int ON_DELETE_NONE
Constructor Detail |
---|
public FKConstraint()
public FKConstraint(java.lang.String name, Relation relation)
name
- a string containing the name of the constraintrelation
- the relation being constrained.Method Detail |
---|
public DBObject copyTo(DBObject target, DBObject copyParent, IDPolicy idPolicy)
AbstractDBObject
This method does not fix internal reference ids on copy. That is done by
the calling DBObject.copyTo(DBObject, IDPolicy)
method.
copyTo
in class AbstractDBObject
DBObject.copyTo(java.lang.Object)
,
DBObject.copyTo(DBObject, boolean)
,
AbstractDBObject.copyToImpl(oracle.javatools.db.AbstractDBObject, oracle.javatools.db.DBObject, oracle.javatools.db.IDPolicy)
public boolean equals(java.lang.Object target)
equals
in class java.lang.Object
protected void copyToImpl(FKConstraint copy, Relation copyParent, IDPolicy idPolicy)
protected boolean equalsImpl(FKConstraint target)
public void setIgnorReferencedSchema(boolean flag)
public boolean isReferencedSchemaIgnored()
public void setReferenceID(DBObjectID id)
id
- The DBObjectID of the referenced constraintpublic DBObjectID getReferenceID()
public java.lang.String getConstraintType()
Constraint
getConstraintType
in class Constraint
public int getDeleteMode()
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.
public void setDeleteMode(int onDelete)
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.
onDelete
- a boolean value indicating whether this constraint specifies
a cascading delete.protected void getReferenceIDsImpl(java.util.Collection<DBObjectID> refs)
AbstractDBObject
getReferenceIDsImpl
in class ColumnConstraint
refs
- the collection of ids this object referencespublic boolean replaceReferenceIDs(java.util.Map<DBObjectID,DBObjectID> idMap)
AbstractDBObject
replaceReferenceIDs
in interface DBObject
replaceReferenceIDs
in class ColumnConstraint
idMap
- key = old DBObjectID, value = new DBObjectID
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |