Class PgConstraintCheck

All Implemented Interfaces:
IHashable, IConstraint, ISearchPath, IStatement

public final 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

    • setInherit

      public void setInherit(boolean isInherit)
    • setExpression

      public void setExpression(String expression)
    • getDefinition

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

      public boolean compare(PgStatement obj)
      Description copied from class: PgStatement
      This method does not account for nested child PgStatements. Shallow version of PgStatement.equals(Object)
      Overrides:
      compare in class PgConstraint
    • 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
    • getErrorCode

      public String getErrorCode()