Adds a constraint on the persistent field specified by name
. The valid values for operation
are defined in ActionDesc. The parameter value
specifies the constraint value.
By default, multiple constraints are implicitly ANDed together. If the applications want to OR together the constraints, it can explicitly add OP_OR constraints. For example, to OR together two constraints, an application can do the following:
addConstraint("field1", ActionDesc.OP_EQ, "field1Value"); addConstraint("field2", ActionDesc.OP_EQ, "field2Value"); addConstraint(null, ActionDesc.OP_OR, null);
The important thing to note about the above example is that the constraints are processed in postfix order, so the above example should be read as
(field1 == "field1Value") OR (field2 == "field2Value")