When writing the "filter" for a JDOQL Query you can make use of some methods on the various Java types.
The range of methods included as standard in JDOQL is not as flexible as with the true Java types, but the ones
that are available are typically of much use. In addition, JPOX adds on many extensions to the JDO specifications
providing all of the commonly required methods.
Below is a list of what is required by JDOQL in JDO 1.0 and JDO 2.0, and what JPOX supports.
| Java Type | Method | Description | Specification | JPOX support |
|---|
| String | startsWith(String) | Returns if the string starts with the passed string | JDO 1.0, JDO 2.0 |  |
| String | endsWith(String) | Returns if the string ends with the passed string | JDO 1.0, JDO 2.0 |  |
| String | indexOf(String) | Returns the first position of the passed string | JDO 2.0 |  |
| String | indexOf(String,int) | Returns the position of the passed string, after the passed position | JDO 2.0 |  |
| String | substring(int) | Returns the substring starting from the passed position | JDO 2.0 |  |
| String | substring(int,int) | Returns the substring between the passed positions | JDO 2.0 |  |
| String | toLowerCase() | Returns the string in lowercase | JDO 2.0 |  |
| String | toUpperCase() | Retuns the string in UPPERCASE | JDO 2.0 |  |
| String | matches(String pattern) | Returns whether string matches the passed expression. The pattern argument follows the rules of java.lang.String.matches method. | JDO 2.0 |  |
| String | like(String pattern) | Returns whether string matches the passed expression. The pattern argument is database specific. |  |  |
| String | charAt(int) | Returns the character at the passed position |  |  |
| String | startsWith(String,int) | Returns if the string starts with the passed string, from the passed position |  |  |
| String | length() | Returns the length of the string |  |  |
| String | equals(String) | Returns if the string is equals to the passed string |  |  |
| String | trim() | Returns a trimmed version of the string |  |  |
| String | trimLeft() | Returns a trimmed version of the string (trimmed for leading spaces) |  |  |
| String | trimRight() | Returns a trimmed version of the string (trimmed for trailing spaces) |  |  |
| String | translate(to,from) [2] | Translates the "from" characters into "to" |  |  |
| Collection | isEmpty() | Returns whether the collection is empty | JDO 1.0, JDO 2.0 |  |
| Collection | contains(value) | Returns whether the collection contains the passed element | JDO 1.0, JDO 2.0 |  |
| Collection | size() | Returns the number of elements in the collection | JDO 2.0 |  |
| Map | isEmpty() | Returns whether the map is empty | JDO 1.0, JDO 2.0 |  |
| Map | contains(value) | Returns whether the map contains the passed value |  |  |
| Map | containsKey(key) | Returns whether the map contains the passed key | JDO 2.0 |  |
| Map | containsValue(value) | Returns whether the map contains the passed value | JDO 2.0 |  |
| Map | containsEntry(key,value) | Returns whether the map contains the passed entry |  |  |
| Map | get(key) | Returns the value from the map with the passed key | JDO 2.0 |  |
| Map | size() | Returns the number of entries in the map | JDO 2.0 |  |
| Math | abs(number) | Returns the absolute value of the passed number | JDO 2.0 |  |
| Math | sqrt(number) | Returns the square root of the passed number | JDO 2.0 |  |
| Math | cos(number) | Returns the cosine of the passed number |  |  |
| Math | sin(number) | Returns the absolute value of the passed number |  |  |
| Math | tan(number) | Returns the tangent of the passed number |  |  |
| Math | acos(number) | Returns the arc cosine of the passed number |  |  |
| Math | asin(number) | Returns the arc sine of the passed number |  |  |
| Math | atan(number) | Returns the arc tangent of the passed number |  |  |
| Math | exp(number) | Returns the exponent of the passed number |  |  |
| Math | log(number) | Returns the log(base e) of the passed number |  |  |
| Math | floor(number) | Returns the floor of the passed number |  |  |
| Math | ceil(number) | Returns the ceiling of the passed number |  |  |
| Date | getDay() | Returns the day (of the month) for the date |  |  |
| Date | getMonth() | Returns the month for the date |  |  |
| Date | getYear() | Returns the year for the date |  |  |
| Time | getHour() | Returns the hour for the time |  |  |
| Time | getMinute() | Returns the minute for the time |  |  |
| Time | getSecond() | Returns the second for the time |  |  |
| JDOHelper | getObjectId(object) | Returns the object identity of the passed persistent object | JDO 2.0 |  |
| Analysis | rollup({object}) | Perform a rollup operation over the results. |  |  |
| Analysis | cube({object}) | Perform a cube operation over the results. |  |  |
| {} | length | Returns the length of an array |  |  |
| {} | contains(object) | Returns true if the array contains the object |  |  |
| Enum | startsWith(String) [1] | Returns if the string starts with the passed string |  |  |
| Enum | endsWith(String) [1] | Returns if the string ends with the passed string |  |  |
| Enum | indexOf(String) [1] | Returns the first position of the passed string |  |  |
| Enum | indexOf(String,int) [1] | Returns the position of the passed string, after the passed position |  |  |
| Enum | substring(int) [1] | Returns the substring starting from the passed position |  |  |
| Enum | substring(int,int) [1] | Returns the substring between the passed positions |  |  |
| Enum | toLowerCase() [1] | Returns the string in lowercase |  |  |
| Enum | toUpperCase() [1] | Retuns the string in UPPERCASE |  |  |
| Enum | matches(String pattern) [1] | Returns whether string matches the passed expression. The pattern argument follows the rules of java.lang.String.matches method. |  |  |
| Enum | like(String pattern) [1] | Returns whether string matches the passed expression. The pattern argument is database specific. |  |  |
| Enum | charAt(int) [1] | Returns the character at the passed position |  |  |
| Enum | startsWith(String,int) [1] | Returns if the string starts with the passed string, from the passed position |  |  |
| Enum | length() [1] | Returns the length of the string |  |  |
| Enum | equals(String) [1] | Returns if the string is equals to the passed string |  |  |
| Enum | trim() [1] | Returns a trimmed version of the string |  |  |
The following sections provide some examples of what can be done using JDOQL methods.