The filter expression for a query is optional. If no filter is set, the filter will be deemed to evaluate to true in all cases, and the query result will be the whole candidate collection.
Query filters are expressions that evaluate to a boolean value. They are structured as zero, one, or more boolean expressions separated by logical NOT (complement), AND, and OR operators, in that order of evaluation. Parentheses may be used to alter the default order of evaluation.
For readers well versed in formal grammars, the grammar for JDOQL is reproduced in Appendix E, in Backus-Naur Form (BNF).
Five logical operators are defined. These are listed and described in Table 8.1.