|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.metadata.Constraint
de.mguennewig.pobjects.metadata.CheckConstraint
public class CheckConstraint
A constraint which checks whether a given boolean expression evaluates to
true or unknown (when a column is null).
The expression is limited by the chosen DBMS. The in-memory checks are
further restricted, see Terms.evalTerm(Term,Record) for details.
| Field Summary |
|---|
| Fields inherited from class de.mguennewig.pobjects.metadata.Constraint |
|---|
MEMBER_NAME |
| Constructor Summary | |
|---|---|
CheckConstraint(java.lang.String schemaName,
Predicate expression)
Create a new check constraint. |
|
| Method Summary | |
|---|---|
void |
check(Record obj)
Checks whether the constraint is fulfilled for the given object. |
Column[] |
getColumns()
Returns the list of columns on which this constraint operates. |
Predicate |
getExpression()
Returns the boolean expression that must evaluate to true
or null. |
java.lang.String |
name(ClassDecl te,
int variant)
Returns different names depending on variant for the code
generator. |
| Methods inherited from class de.mguennewig.pobjects.metadata.Constraint |
|---|
getSchemaName, isImplicit |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CheckConstraint(java.lang.String schemaName,
Predicate expression)
| Method Detail |
|---|
public final Column[] getColumns()
public final Predicate getExpression()
true
or null.
check(de.mguennewig.pobjects.Record)
public void check(Record obj)
throws PObjConstraintException
object.
If the expression is not supported to test in-memory then this constraint is ignored and it must be tested by the DBMS.
check in class ConstraintPObjConstraintException - when the constraint isn't fulfilled.Terms.evalTerm(Term,Record)
public java.lang.String name(ClassDecl te,
int variant)
variant for the code
generator.
name in class Constraintvariant | return value |
|---|---|
Constraint.MEMBER_NAME |
check< |
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||