String Operations

Strings need some extra explanation. To implement flexible queries, Signsoft intelliBO offers some additional features, which are related to those of the String class.

MethodMeaning
startsWithThe string has to start with the specified search criteria.
endsWithThe string has to end with the specified search criteria.
containsThe string has to contain the specified search criteria.
patternThe search text is passed to the database system without modification. You can use the SQL placeholders "%" (any character, zero or more) or "_" (exactly one character).

A Method uses dot notation for its first parameter, the other parameters are placed in an argument list, e.g. "lastName.startsWith(\"er\")".

FunctionMeaning
upperThe specified attribute will be converted into uppercase letters before making the comparison. The operation runs in the database.
lowerThe specified attribute will be converted into lowercase letters before making the comparison. The operation runs in the database.

A Function has only an argument list, e.g. "upper(lastName)".

OperatorMeaning
likeThe search text is passed to the database system without modification. You can use the SQL placeholders "%" (any character, zero or more) or "_" (exactly one character).

A Operator is placed between arguments, e.g. "lastName like \"er%\"".

Using these functions, you could create queries like these:

// all persons with leading 'M' in last name
query.setFilter("lastName.startsWith('M')");

// all persons with trailing "er" in last name
query.setFilter("lastName.endsWith(\"er\")");

// all persons with 2nd character "e" in first name
query.setFilter("firstName.pattern(\"_e%\")");
Note that the string must be enclosed with quotation marks. By using quotation marks you can express blanks in strings. If you want to search for quotation marks within a string, please use a parameter for the search string.

The following example shows how to make a case-insensitive query for a specific firstname that starts with "MAS":

filter = "upper(firstName) like (\"MAS\")";