public abstract class Constraint extends AbstractChildBuildableObject
Constraint
represents a constraint on a table or view.Relation.getConstraints()
Modifier and Type | Class and Description |
---|---|
static class |
Constraint.DeferrableState |
AbstractDBObject.ChildSupport, AbstractDBObject.ListenerSupport
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE |
Modifier | Constructor and Description |
---|---|
protected |
Constraint()
Constructs a new Constraint.
|
protected |
Constraint(java.lang.String name,
Relation relation)
Constructs a new Constraint on a relation with a specific name, and adds
the constraint to the relation.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<Constraint> |
getConstraints(Relation rel,
java.lang.String... types)
Lists the constraints on a given Relation that are of the given constraint
types.
|
abstract java.lang.String |
getConstraintType()
Retrieves the type of constraint represented by this instance.
|
static java.util.Collection<java.lang.String> |
getConstraintTypes()
Gets a list of the valid constraint types support in the API.
|
Constraint.DeferrableState |
getDeferrableState()
The deferrable state of the Constraint.
|
Relation |
getRelation()
Gets the
Relation that owns this Constraint. |
java.lang.String |
getType()
Returns the type of this object.
|
boolean |
isEnabled()
Whether this constraint is current enabled.
|
void |
setDeferrableState(Constraint.DeferrableState defer)
Sets the deferrable state of this constraint.
|
void |
setEnabled(boolean enabled)
Sets the enabled state of this constraint.
|
void |
setRelation(Relation relation)
Sets the
Relation that owns this Constraint. |
setParent
checkInit, checkInit, copyToImpl, getOwnedObjectsImpl, getProperties, getReferenceIDsImpl, needsInitialization
addObjectListener, addObjectListener, addObjectListener, changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, findOwnedObject, findParent, fireObjectUpdated, firePropertyChanged, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getProperty, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeObjectListener, removeObjectListener, removeObjectListener, removeOwnedObject, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, setProperty, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getParent
addObjectListener, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getProperties, getReferenceIDs, hashCode, removeObjectListener, removeOwnedObject, replaceReferenceIDs, setID, setName
getProperty, getProperty, setProperties, setProperty
public static final java.lang.String TYPE
protected Constraint()
protected Constraint(java.lang.String name, Relation relation)
name
- a string containing the constraint namerelation
- the relation being constrainedpublic void setEnabled(boolean enabled)
enabled
- a boolean value indicating whether this constraint it
is enabled.public boolean isEnabled()
public void setDeferrableState(Constraint.DeferrableState defer)
defer
- the deferrable state for the constraint.public Constraint.DeferrableState getDeferrableState()
public java.lang.String getType()
DBObject
public abstract java.lang.String getConstraintType()
public Relation getRelation()
Relation
that owns this Constraint.public void setRelation(Relation relation)
Relation
that owns this Constraint.relation
- the Relation that owns this constraint.public static java.util.Collection<Constraint> getConstraints(Relation rel, java.lang.String... types)
rel
- the relation to list the constraints fromtypes
- the types of constraint requiredgetConstraintType()
public static java.util.Collection<java.lang.String> getConstraintTypes()