Package org.pgcodekeeper.core.schema.ms
Class MsConstraint
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractConstraint
org.pgcodekeeper.core.schema.ms.MsConstraint
- All Implemented Interfaces:
IHashable,IConstraint,ISearchPath,IStatement
- Direct Known Subclasses:
MsConstraintCheck,MsConstraintFk,MsConstraintPk
Abstract base class for Microsoft SQL table constraints.
Provides common functionality for constraint management including disabled state handling.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(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.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.voidgetDropSQL(SQLScript script, boolean optionExists) Generates DROP SQL for this statement.voidsetDisabled(boolean isDisabled) Copies all object properties into a new object and leaves all its children empty.Methods inherited from class org.pgcodekeeper.core.schema.AbstractConstraint
containsColumn, getColumns, 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
getDefinition, isPrimaryKeyMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Method Details
-
getCreationSQL
Description copied from class:PgStatementGenerates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.- Specified by:
getCreationSQLin classPgStatement- Parameters:
script- the SQL script to append creation statements to
-
appendAlterSQL
Description copied from class:PgStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin classPgStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
getDropSQL
Description copied from class:PgStatementGenerates DROP SQL for this statement.- Overrides:
getDropSQLin classPgStatement- Parameters:
script- the SQL script to append the DROP statement tooptionExists- whether to include "IF EXISTS" in the DROP statement
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractConstraint
-
setDisabled
public void setDisabled(boolean isDisabled) -
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 classAbstractConstraint- Parameters:
hasher- the hasher instance to use for hash computation
-
shallowCopy
Description copied from class:PgStatementCopies all object properties into a new object and leaves all its children empty.- Overrides:
shallowCopyin classAbstractConstraint- Returns:
- shallow copy of a DB object.
-
getDbType
- Overrides:
getDbTypein classPgStatement
-