public abstract class Constraint extends SchemaObject implements java.lang.Comparable<Constraint>
| Modifier and Type | Class and Description |
|---|---|
static class |
Constraint.Type |
| Modifier and Type | Field and Description |
|---|---|
protected Table |
table
The table for which this constraint is defined.
|
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USERADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| Modifier and Type | Method and Description |
|---|---|
abstract void |
checkExistingData(SessionLocal session)
Check the existing data.
|
abstract void |
checkRow(SessionLocal session,
Table t,
Row oldRow,
Row newRow)
Check if this row fulfils the constraint.
|
int |
compareTo(Constraint other) |
abstract Constraint.Type |
getConstraintType()
The constraint type name
|
abstract java.lang.String |
getCreateSQLWithoutIndexes()
Get the SQL statement to create this constraint.
|
Expression |
getExpression()
Returns the CHECK expression or null.
|
Index |
getIndex()
Get the index of this constraint in the source table, or null if no index
is used.
|
abstract java.util.HashSet<Column> |
getReferencedColumns(Table table)
Get all referenced columns.
|
ConstraintUnique |
getReferencedConstraint()
Returns the referenced unique constraint, or null.
|
Table |
getRefTable() |
Table |
getTable() |
int |
getType()
Get the object type.
|
abstract boolean |
isBefore()
Check if this constraint needs to be checked before updating the data.
|
boolean |
isEverything(ExpressionVisitor visitor)
Visit all elements in the constraint.
|
boolean |
isHidden()
Check whether this is a hidden object that doesn't appear in the meta
data and in the script, and is not dropped on DROP ALL OBJECTS.
|
abstract void |
rebuild()
This method is called after a related table has changed
(the table was renamed, or columns have been renamed).
|
abstract void |
setIndexOwner(Index index)
This index is now the owner of the specified index.
|
abstract boolean |
usesIndex(Index index)
Check if this constraint needs the specified index.
|
getSchema, getSQL, getSQLcheckRename, getChildren, getComment, getCreateSQL, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, removeChildrenAndResources, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLprotected Table table
public abstract Constraint.Type getConstraintType()
public abstract void checkRow(SessionLocal session, Table t, Row oldRow, Row newRow)
session - the sessiont - the tableoldRow - the old rownewRow - the new rowpublic abstract boolean usesIndex(Index index)
index - the indexpublic abstract void setIndexOwner(Index index)
index - the indexpublic abstract java.util.HashSet<Column> getReferencedColumns(Table table)
table - the tablepublic Expression getExpression()
public abstract java.lang.String getCreateSQLWithoutIndexes()
public abstract boolean isBefore()
public abstract void checkExistingData(SessionLocal session)
session - the sessionpublic abstract void rebuild()
public Index getIndex()
public ConstraintUnique getReferencedConstraint()
public int getType()
DbObjectpublic Table getTable()
public Table getRefTable()
public int compareTo(Constraint other)
compareTo in interface java.lang.Comparable<Constraint>public boolean isHidden()
SchemaObjectisHidden in class SchemaObjectpublic boolean isEverything(ExpressionVisitor visitor)
visitor - the visitor