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| 构造器和说明 |
|---|
ConstraintReferential(Schema schema,
int id,
String name,
Table table) |
| 限定符和类型 | 方法和说明 |
|---|---|
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
|
String |
getCreateSQL()
Construct the CREATE ...
|
String |
getCreateSQLForCopy(Table forTable,
String quotedName)
Create the SQL statement of this object so a copy of the table can be
made.
|
String |
getCreateSQLForCopy(Table forTable,
Table forRefTable,
String quotedName,
boolean internalIndex)
Create the SQL statement of this object so a copy of the table can be
made.
|
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() |
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 在类中 Constraintpublic String getCreateSQLForCopy(Table forTable, String quotedName)
getCreateSQLForCopy 在类中 DbObjectforTable - the table to create the object forquotedName - the name of this object (quoted if necessary)public String getCreateSQLForCopy(Table forTable, Table forRefTable, 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 String getCreateSQLWithoutIndexes()
ConstraintgetCreateSQLWithoutIndexes 在类中 Constraintpublic String getCreateSQL()
DbObjectgetCreateSQL 在类中 DbObjectpublic void setColumns(IndexColumn[] cols)
public IndexColumn[] getColumns()
public HashSet<Column> getReferencedColumns(Table table)
ConstraintgetReferencedColumns 在类中 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 在类中 DbObjectsession - the sessionpublic void checkRow(SessionLocal session, Table t, Row oldRow, Row newRow)
ConstraintcheckRow 在类中 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 在类中 Constraintpublic Table getRefTable()
getRefTable 在类中 Constraintpublic boolean usesIndex(Index idx)
ConstraintusesIndex 在类中 Constraintidx - the indexpublic void setIndexOwner(Index index)
ConstraintsetIndexOwner 在类中 Constraintindex - the indexpublic boolean isBefore()
ConstraintisBefore 在类中 Constraintpublic void checkExistingData(SessionLocal session)
ConstraintcheckExistingData 在类中 Constraintsession - the sessionpublic Index getIndex()
ConstraintgetIndex 在类中 Constraintpublic ConstraintUnique getReferencedConstraint()
ConstraintgetReferencedConstraint 在类中 ConstraintCopyright © 2022. All rights reserved.