Package com.exedio.cope
Class CheckConstraint
java.lang.Object
com.exedio.cope.Feature
com.exedio.cope.CheckConstraint
- All Implemented Interfaces:
Copyable
,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
check()
Checks, whether the database fulfills this check constraint.copy
(CopyMapper mapper) boolean
Return true iff this check constraint can be supported by a database dialect supporting check constraints.Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Constructor Details
-
CheckConstraint
-
-
Method Details
-
copy
-
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 bythe 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 iffisSupportedBySchemaIfSupportedByDialect()
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.
-