Package org.pgcodekeeper.core.schema.ms
Class MsConstraintFk
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractConstraint
org.pgcodekeeper.core.schema.ms.MsConstraint
org.pgcodekeeper.core.schema.ms.MsConstraintFk
- All Implemented Interfaces:
IHashable,IConstraint,IConstraintFk,ISearchPath,IStatement
Represents a Microsoft SQL FOREIGN KEY constraint that enforces referential integrity
between tables.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
ConstructorsConstructorDescriptionMsConstraintFk(String name) Creates a new Microsoft SQL FOREIGN KEY constraint. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a column to this foreign key constraint.voidaddForeignColumn(String referencedColumn) Adds a referenced column to this foreign key constraint.booleancompare(PgStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.Gets the columns involved in this constraint.Gets the SQL definition of this constraint.Gets the foreign columns referenced by this foreign key.Gets the foreign schema containing the referenced table.Gets the foreign table referenced by this foreign key.voidsetDelAction(String delAction) voidsetForeignSchema(String foreignSchema) voidsetForeignTable(String foreignTable) voidsetNotForRepl(boolean isNotForRepl) voidsetUpdAction(String updAction) Methods inherited from class org.pgcodekeeper.core.schema.ms.MsConstraint
appendAlterSQL, getCreationSQL, getDbType, getDropSQL, setDisabled, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.AbstractConstraint
containsColumn, getContainingSchema, getLocation, getStatementType, getTableName, isNotValid, isSubElement, setNotValidMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDeps, getDescendants, getDropSQL, getLibName, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.IConstraint
containsColumn, getTableName, isPrimaryKeyMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName, getStatementType
-
Constructor Details
-
MsConstraintFk
Creates a new Microsoft SQL FOREIGN KEY constraint.- Parameters:
name- the constraint name
-
-
Method Details
-
getColumns
Description copied from interface:IConstraintGets the columns involved in this constraint.- Specified by:
getColumnsin interfaceIConstraint- Overrides:
getColumnsin classAbstractConstraint- Returns:
- a collection of column names
-
addColumn
Adds a column to this foreign key constraint.- Parameters:
column- the column name to add
-
getForeignColumns
Description copied from interface:IConstraintFkGets the foreign columns referenced by this foreign key.- Specified by:
getForeignColumnsin interfaceIConstraintFk- Returns:
- a collection of foreign column names
-
addForeignColumn
Adds a referenced column to this foreign key constraint.- Parameters:
referencedColumn- the referenced column name to add
-
getForeignTable
Description copied from interface:IConstraintFkGets the foreign table referenced by this foreign key.- Specified by:
getForeignTablein interfaceIConstraintFk- Returns:
- the foreign table name
-
setForeignTable
-
getForeignSchema
Description copied from interface:IConstraintFkGets the foreign schema containing the referenced table.- Specified by:
getForeignSchemain interfaceIConstraintFk- Returns:
- the foreign schema name
-
setForeignSchema
-
setDelAction
-
setUpdAction
-
setNotForRepl
public void setNotForRepl(boolean isNotForRepl) -
getDefinition
Description copied from interface:IConstraintGets the SQL definition of this constraint.- Specified by:
getDefinitionin interfaceIConstraint- Returns:
- the constraint definition
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classMsConstraint
-
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Overrides:
computeHashin classMsConstraint- Parameters:
hasher- the hasher instance to use for hash computation
-