oracle.jdeveloper.cm.ds.db
Class CheckConstraint
java.lang.Object
oracle.jdeveloper.cm.ds.db.AbstractDBObject
oracle.jdeveloper.cm.ds.db.Constraint
oracle.jdeveloper.cm.ds.db.CheckConstraint
- All Implemented Interfaces:
- Copyable, DBObject, Subject
- public class CheckConstraint
- extends Constraint
A CheckConstraint
constrains a table or view based on a conditional expression.
Fields inherited from class oracle.jdeveloper.cm.ds.db.Constraint |
TYPE |
Fields inherited from interface oracle.jdeveloper.cm.ds.db.DBObject |
COMMENT |
Constructor Summary |
CheckConstraint()
Creates a new CheckConstraint. |
CheckConstraint(java.lang.String name, Relation relation)
Constructs a new CheckConstraint on a relation with a specific name. |
Method Summary |
java.lang.Object |
copyTo(java.lang.Object target)
Copies the state of this DBObject to another instance. |
protected void |
copyToImpl(CheckConstraint copy)
|
boolean |
equals(java.lang.Object target)
|
protected boolean |
equalsImpl(CheckConstraint target)
|
java.lang.String |
getCheckCondition()
Retrieves the conditional expression represented by this constraint. |
java.lang.String |
getConstraintType()
Retrieves the type of constraint represented by this instance. |
void |
setCheckCondition(java.lang.String condition)
Sets the conditional expression represented by this constraint. |
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 |
CONSTRAINT_TYPE
public static final java.lang.String CONSTRAINT_TYPE
-
- See Also:
- Constant Field Values
CheckConstraint
public CheckConstraint(java.lang.String name,
Relation relation)
- Constructs a new CheckConstraint on a relation with a specific name.
- Parameters:
name
- a string representing name of the constraint
relation
- the relation being constrained
CheckConstraint
public CheckConstraint()
- Creates a new CheckConstraint.
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(CheckConstraint copy)
equalsImpl
protected boolean equalsImpl(CheckConstraint target)
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.
getCheckCondition
public java.lang.String getCheckCondition()
- Retrieves the conditional expression represented by this constraint.
-
- Returns:
- a string containing the conditional expression
setCheckCondition
public void setCheckCondition(java.lang.String condition)
- Sets the conditional expression represented by this constraint.
-
- Parameters:
condition
- a string containing the conditional expression
Copyright © 1997, 2004, Oracle. All rights reserved.