Package org.pgcodekeeper.core.schema.pg
Class PgConstraintCheck
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractConstraint
org.pgcodekeeper.core.schema.pg.PgConstraint
org.pgcodekeeper.core.schema.pg.PgConstraintCheck
- All Implemented Interfaces:
IHashable,IConstraint,ISearchPath,IStatement
PostgreSQL CHECK constraint implementation.
CHECK constraints enforce domain integrity by limiting the values
that can be placed in a column based on a Boolean expression.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancompare(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 SQL definition of this constraint.voidsetExpression(String expression) voidsetInherit(boolean isInherit) Methods inherited from class org.pgcodekeeper.core.schema.pg.PgConstraint
appendAlterSQL, getCreationSQL, getDropSQL, setDeferrable, setInitially, shallowCopyMethods 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, getDbType, 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
isPrimaryKeyMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Constructor Details
-
PgConstraintCheck
Creates a new PostgreSQL CHECK constraint.- Parameters:
name- constraint name
-
-
Method Details
-
setInherit
public void setInherit(boolean isInherit) -
setExpression
-
getDefinition
Description copied from interface:IConstraintGets the SQL definition of this constraint.- 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 classPgConstraint
-
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 classPgConstraint- Parameters:
hasher- the hasher instance to use for hash computation
-
getErrorCode
-