The syntax of the query language is based on the syntax of Java itself. You are free to use the well-known comparison operators or logical operators of Java. Signsoft intelliBO will translate these operators automatically into SQL operators to pass the query to your database system.
| Operator | SQL | Meaning |
|---|---|---|
| == | = | equal |
| != | != | not equal |
| > | > | greater than |
| < | < | less than |
| >= | >= | greater than or equal |
| <= | <= | less than or equal |
| && | AND | logical and |
| || | OR | logical or |
| ! | NOT | logical not |
You can combine these operators as you do in Java. Complex expressions can be realized using brackets.
The following example shows the use of filters:
// all persons with a key less than 50
query.setFilter("key < 50");
// all persons with a key value between 50 and 100
query.setFilter("(key >= 50) && (key <= 100)");
The query language supports even filtering by specifying related classes (implicitly related table rows). Again, the same syntax is used here, as one would specify in Java.
For the next sample we assume that every Person object has a reference to an Address object (one-to-one relation), and the reference is available using the attribute addr . Furthermore, the Address has an attribute city , which stores the city name. For every class a table and the corresponding mappings exists. To find all persons living in the city Dresden, specify the following filter:
query.setFilter("addr.city == \"Dresden\"");
Please note that the returned collection of the result ( Person objects) does not contain Person objects that have no associated address. For those objects the filter cannot be applied.