public class ConstraintUnique extends Constraint
Constraint.TypetableAGGREGATE, 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| Constructor and Description |
|---|
ConstraintUnique(Schema schema,
int id,
java.lang.String name,
Table table,
boolean primaryKey,
NullsDistinct nullsDistinct) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkExistingData(SessionLocal session)
Check the existing data.
|
void |
checkRow(SessionLocal session,
Table t,
Row oldRow,
Row newRow)
Check if this row fulfils the constraint.
|
IndexColumn[] |
getColumns() |
Constraint.Type |
getConstraintType()
The constraint type name
|
java.lang.String |
getCreateSQL()
Construct the CREATE ...
|
java.lang.String |
getCreateSQLForCopy(Table forTable,
java.lang.String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the
object with a different name or referencing a different table
|
java.lang.String |
getCreateSQLWithoutIndexes()
Get the SQL statement to create this constraint.
|
Index |
getIndex()
Get the index of this constraint in the source table, or null if no index
is used.
|
NullsDistinct |
getNullsDistinct() |
java.util.HashSet<Column> |
getReferencedColumns(Table table)
Get all referenced columns.
|
boolean |
isBefore()
Check if this constraint needs to be checked before updating the data.
|
void |
rebuild()
This method is called after a related table has changed
(the table was renamed, or columns have been renamed).
|
void |
removeChildrenAndResources(SessionLocal session)
Delete all dependent children objects and resources of this object.
|
void |
setColumns(IndexColumn[] columns) |
void |
setIndex(Index index,
boolean isOwner)
Set the index to use for this unique constraint.
|
void |
setIndexOwner(Index index)
This index is now the owner of the specified index.
|
boolean |
usesIndex(Index idx)
Check if this constraint needs the specified index.
|
compareTo, getExpression, getReferencedConstraint, getRefTable, getTable, getType, isEverything, isHiddengetSchema, getSQL, getSQLcheckRename, getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic ConstraintUnique(Schema schema, int id, java.lang.String name, Table table, boolean primaryKey, NullsDistinct nullsDistinct)
public Constraint.Type getConstraintType()
ConstraintgetConstraintType in class Constraintpublic java.lang.String getCreateSQLForCopy(Table forTable, java.lang.String quotedName)
DbObjectgetCreateSQLForCopy in class DbObjectforTable - the new tablequotedName - the quoted namepublic java.lang.String getCreateSQLWithoutIndexes()
ConstraintgetCreateSQLWithoutIndexes in class Constraintpublic java.lang.String getCreateSQL()
DbObjectgetCreateSQL in class DbObjectpublic void setColumns(IndexColumn[] columns)
public IndexColumn[] getColumns()
public void setIndex(Index index, boolean isOwner)
index - the indexisOwner - true if the index is generated by the system and belongs
to this constraintpublic void removeChildrenAndResources(SessionLocal session)
DbObjectremoveChildrenAndResources in class DbObjectsession - the sessionpublic void checkRow(SessionLocal session, Table t, Row oldRow, Row newRow)
ConstraintcheckRow in class Constraintsession - the sessiont - the tableoldRow - the old rownewRow - the new rowpublic boolean usesIndex(Index idx)
ConstraintusesIndex in class Constraintidx - the indexpublic void setIndexOwner(Index index)
ConstraintsetIndexOwner in class Constraintindex - the indexpublic java.util.HashSet<Column> getReferencedColumns(Table table)
ConstraintgetReferencedColumns in class Constrainttable - the tablepublic boolean isBefore()
ConstraintisBefore in class Constraintpublic void checkExistingData(SessionLocal session)
ConstraintcheckExistingData in class Constraintsession - the sessionpublic Index getIndex()
ConstraintgetIndex in class Constraintpublic void rebuild()
Constraintrebuild in class Constraintpublic NullsDistinct getNullsDistinct()