public abstract class Constraint extends SchemaObjectBase implements Comparable<Constraint>
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CHECK
The constraint type name for check constraints.
|
static String |
PRIMARY_KEY
The constraint type name for primary key constraints.
|
static String |
REFERENTIAL
The constraint type name for referential constraints.
|
protected Table |
table
The table for which this constraint is defined.
|
static String |
UNIQUE
The constraint type name for unique constraints.
|
comment, database, traceAGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
checkExistingData(Session session)
Check the existing data.
|
void |
checkRename()
Check if this object can be renamed.
|
abstract void |
checkRow(Session session,
Table t,
Row oldRow,
Row newRow)
Check if this row fulfils the constraint.
|
int |
compareTo(Constraint other) |
abstract String |
getConstraintType()
The constraint type name
|
abstract String |
getCreateSQLWithoutIndexes()
Get the SQL statement to create this constraint.
|
String |
getDropSQL()
Build a SQL statement to drop this object.
|
abstract HashSet<Column> |
getReferencedColumns(Table table)
Get all referenced columns.
|
Table |
getRefTable() |
Table |
getTable() |
int |
getType()
Get the object type.
|
abstract Index |
getUniqueIndex()
Get the unique index used to enforce this constraint, or null if no index
is used.
|
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, initSchemaObjectBasegetChildren, getComment, getCreateSQL, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, isValid, removeChildrenAndResources, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildren, getComment, getCreateSQL, getCreateSQLForCopy, getDatabase, getId, getName, isTemporary, removeChildrenAndResources, rename, setComment, setTemporarypublic static final String REFERENTIAL
public static final String UNIQUE
public static final String PRIMARY_KEY
protected Table table
public abstract String getConstraintType()
public abstract void checkRow(Session 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 HashSet<Column> getReferencedColumns(Table table)
table - the tablepublic abstract String getCreateSQLWithoutIndexes()
public abstract boolean isBefore()
public abstract void checkExistingData(Session session)
session - the sessionpublic abstract void rebuild()
public abstract Index getUniqueIndex()
public void checkRename()
DbObjectBasecheckRename 在接口中 DbObjectcheckRename 在类中 DbObjectBasepublic int getType()
DbObjectpublic Table getTable()
public Table getRefTable()
public String getDropSQL()
DbObjectBasegetDropSQL 在接口中 DbObjectgetDropSQL 在类中 DbObjectBasepublic int compareTo(Constraint other)
compareTo 在接口中 Comparable<Constraint>public boolean isHidden()
SchemaObjectisHidden 在接口中 SchemaObjectisHidden 在类中 SchemaObjectBasepublic boolean isEverything(ExpressionVisitor visitor)
visitor - the visitorCopyright © 2017. All rights reserved.