public class ConstraintReferential 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 |
|---|
ConstraintReferential(Schema schema,
int id,
java.lang.String name,
Table table) |
| 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)
Create the SQL statement of this object so a copy of the table can be
made.
|
java.lang.String |
getCreateSQLForCopy(Table forTable,
Table forRefTable,
java.lang.String quotedName,
boolean internalIndex)
Create the SQL statement of this object so a copy of the table can be
made.
|
java.lang.String |
getCreateSQLWithoutIndexes()
Get the SQL statement to create this constraint.
|
ConstraintActionType |
getDeleteAction() |
Index |
getIndex()
Get the index of this constraint in the source table, or null if no index
is used.
|
IndexColumn[] |
getRefColumns() |
java.util.HashSet<Column> |
getReferencedColumns(Table table)
Get all referenced columns.
|
ConstraintUnique |
getReferencedConstraint()
Returns the referenced unique constraint, or null.
|
Table |
getRefTable() |
ConstraintActionType |
getUpdateAction() |
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[] cols) |
void |
setDeleteAction(ConstraintActionType action)
Set the action to apply (restrict, cascade,...) on a delete.
|
void |
setIndex(Index index,
boolean isOwner)
Set the index to use for this constraint.
|
void |
setIndexOwner(Index index)
This index is now the owner of the specified index.
|
void |
setRefColumns(IndexColumn[] refCols) |
void |
setRefConstraint(ConstraintUnique refConstraint)
Set the unique constraint of the referenced table to use for this
constraint.
|
void |
setRefTable(Table refTable) |
void |
setUpdateAction(ConstraintActionType action)
Set the action to apply (restrict, cascade,...) on an update.
|
void |
updateOnTableColumnRename()
Update the constraint SQL when a referenced column is renamed.
|
boolean |
usesIndex(Index idx)
Check if this constraint needs the specified index.
|
compareTo, getExpression, 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 Constraint.Type getConstraintType()
ConstraintgetConstraintType in class Constraintpublic java.lang.String getCreateSQLForCopy(Table forTable, java.lang.String quotedName)
getCreateSQLForCopy in class DbObjectforTable - the table to create the object forquotedName - the name of this object (quoted if necessary)public java.lang.String getCreateSQLForCopy(Table forTable, Table forRefTable, java.lang.String quotedName, boolean internalIndex)
forTable - the table to create the object forforRefTable - the referenced tablequotedName - the name of this object (quoted if necessary)internalIndex - add the index name to the statementpublic java.lang.String getCreateSQLWithoutIndexes()
ConstraintgetCreateSQLWithoutIndexes in class Constraintpublic java.lang.String getCreateSQL()
DbObjectgetCreateSQL in class DbObjectpublic void setColumns(IndexColumn[] cols)
public IndexColumn[] getColumns()
public java.util.HashSet<Column> getReferencedColumns(Table table)
ConstraintgetReferencedColumns in class Constrainttable - the tablepublic void setRefColumns(IndexColumn[] refCols)
public IndexColumn[] getRefColumns()
public void setRefTable(Table refTable)
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 setRefConstraint(ConstraintUnique refConstraint)
refConstraint - the unique 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 ConstraintActionType getDeleteAction()
public void setDeleteAction(ConstraintActionType action)
action - the actionpublic void updateOnTableColumnRename()
public ConstraintActionType getUpdateAction()
public void setUpdateAction(ConstraintActionType action)
action - the actionpublic void rebuild()
Constraintrebuild in class Constraintpublic Table getRefTable()
getRefTable in class Constraintpublic boolean usesIndex(Index idx)
ConstraintusesIndex in class Constraintidx - the indexpublic void setIndexOwner(Index index)
ConstraintsetIndexOwner in class Constraintindex - the indexpublic boolean isBefore()
ConstraintisBefore in class Constraintpublic void checkExistingData(SessionLocal session)
ConstraintcheckExistingData in class Constraintsession - the sessionpublic Index getIndex()
ConstraintgetIndex in class Constraintpublic ConstraintUnique getReferencedConstraint()
ConstraintgetReferencedConstraint in class Constraint