Setting operators in the API are similar to setting operators in TeamConnect custom searches. To search with operators, use the FieldCriterion class and all the classes that extend it. FieldCriterion includes methods for operators that you can use on all fields.
Because each data type has different operators, each data type class has its own set of methods for using operators. These methods are part of the following classes:
•BooleanCriterion—Operators for Boolean fields.
•CategoryCriterion—Operators for categories.
•DateCriterion—Operators for date fields.
•DecimalCriterion—Operators for BigDecimal fields.
•EnumerationCriterion—Operators for enum-based fields.
•IntegerCriterion—Operators for integer fields.
•LookupItemCriterion—Operators for lookup table fields.
•ObjectCriterion—Operators for account, contact, project, and user fields.
•RelativeDateCriterion—Operators for integers before and after a certain date.
•StringCriterion—Operators for string fields.
In the case of the example for system field searching without the operator, the entire criterion looks like the following code with the operator:
StringCriterion locationCriterion = new StringCriterion(Appointment.LOCATION).equalTo("Room 101"); |