Class PgConstraintCheck

All Implemented Interfaces:
IConstraint, ISearchPath, IStatement, ISubElement, IHashable

public class PgConstraintCheck extends PgConstraint
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.
  • Constructor Details

    • PgConstraintCheck

      public PgConstraintCheck(String name)
      Creates a new PostgreSQL CHECK constraint.
      Parameters:
      name - constraint name
  • Method Details

    • getDefinition

      public String getDefinition()
      Description copied from interface: IConstraint
      Gets the SQL definition of this constraint.
      Returns:
      the constraint definition
    • getErrorCode

      public String getErrorCode()
    • setInherit

      public void setInherit(boolean isInherit)
    • setExpression

      public void setExpression(String expression)
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Overrides:
      computeHash in class PgConstraint
      Parameters:
      hasher - the hasher instance to use for hash computation
    • compare

      public boolean compare(IStatement obj)
      Description copied from class: AbstractStatement
      This method does not account for nested child PgStatements. Shallow version of AbstractStatement.equals(Object)
      Specified by:
      compare in interface IStatement
      Overrides:
      compare in class PgConstraint