public class CheckConstraint extends Constraint
CheckConstraint constrains a table or view based on a
conditional expression.
Constraint.DeferrableStateAbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONSTRAINT_TYPE |
TYPE| Constructor and Description |
|---|
CheckConstraint()
Creates a new CheckConstraint.
|
CheckConstraint(java.lang.String name,
Relation relation)
Constructs a new CheckConstraint for a relation with a specific name.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyToImpl(AbstractDBObject copy,
DBObject copyParent,
IDPolicy idPolicy)
Implementation method for making a copy of this object.
|
DBObject |
findOwnedObject(DBObjectID id,
boolean strict)
Returns a child of this object that has the given ID.
|
java.lang.String |
getCheckCondition()
Retrieves the conditional expression represented by this constraint.
|
SQLFragment |
getCheckConditionFragment()
Retrieves the conditional expression represented by this constraint
which is derived from the check condition.
|
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.
|
void |
setCheckConditionFragment(SQLFragment condition)
Sets the conditional expression represented by this constraint which
is derived from the check condition.
|
getConstraints, getConstraintTypes, getDeferrableState, getRelation, getType, isEnabled, setDeferrableState, setEnabled, setRelationsetParentcheckInit, checkInit, getOwnedObjectsImpl, getProperties, getReferenceIDsImpl, needsInitialization, processPropertyChange, setIDaddObjectListener, addObjectListener, addObjectListener, changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, findParent, fireObjectUpdated, firePropertyChanged, getChildSupport, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeObjectListener, removeObjectListener, removeObjectListener, removeOwnedObject, removeThisAsParent, replaceReferenceIDs, setName, setProperties, setProperty, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetParentaddObjectListener, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getProperties, getProperty, getProperty, getReferenceIDs, hashCode, removeObjectListener, removeOwnedObject, replaceReferenceIDs, setID, setName, setProperties, setPropertypublic static final java.lang.String CONSTRAINT_TYPE
public CheckConstraint(java.lang.String name,
Relation relation)
Relation.addConstraint(Constraint) when the constraint
definition is complete.name - a string representing name of the constraintrelation - the relation being constrainedpublic CheckConstraint()
public java.lang.String getConstraintType()
ConstraintgetConstraintType in class Constraintpublic java.lang.String getCheckCondition()
public void setCheckCondition(java.lang.String condition)
condition - a string containing the conditional expressionpublic SQLFragment getCheckConditionFragment()
public void setCheckConditionFragment(SQLFragment condition)
condition - a SQLFragment representing the expression set as the
"check condition".setCheckCondition(String)public DBObject findOwnedObject(DBObjectID id, boolean strict)
DBObjectNote: an unstrict comparison can be time consuming, only request it if you need it (i.e. you are searching using a DBObjectID that did not originate in this object's heirarchy).
The method does not recurse to look for children of children.
This will not find SchemaObjects in a Schema, as in the API the Schema -> SchemaObject relationship is not an owner -> owned object relationship.
findOwnedObject in interface DBObjectfindOwnedObject in class AbstractDBObjectid - the id to look forstrict - whether to stricly compare IDs or notDBObjectID.equals(DBObjectID,boolean)protected void copyToImpl(AbstractDBObject copy, DBObject copyParent, IDPolicy idPolicy)
AbstractDBObjectcopyToImpl in class AbstractBuildableObjectcopy - the copy being created of this objectcopyParent - if this object is being copied underneath a parent, this
parameter is the copy of the parent of this object, which will therefore
need to be the parent of the copy of this object.idPolicy - the policy for copying the object's ID.