Class CheckConstraint

    • Constructor Detail

      • CheckConstraint

        public CheckConstraint​(Condition condition)
    • Method Detail

      • getCondition

        public Condition getCondition()
      • isSupportedBySchemaIfSupportedByDialect

        public boolean isSupportedBySchemaIfSupportedByDialect()
        Return true iff this check constraint can be supported by a database dialect supporting check constraints. This is the case, iff all table columns mentioned by the condition if the check constraints are located within the same database table.

        The result of this method does not depend on SchemaInfo.supportsCheckConstraints(Model).

        If returns false, you should call check() for checking database consistency after any modifications of the database bypassing cope.

      • check

        public int check()
        Checks, whether the database fulfills this check constraint. Should be called for checking database consistency after any modifications of the database bypassing cope. Is needed especially iff isSupportedBySchemaIfSupportedByDialect() returns false.

        Returns the number of items violating the check constraint. As a consequence, this methods returns 0 (zero), iff the database fulfills this check constraint.