| Basic usage is "select ${classname} where ${propertyname} [=,<,>,!=,>=,<=] 'value'"
multiproperty queries are of the form
"select ${classname} where ${propertyname} [=,<,>,!=,>=,<=] 'value' [and,or] ${propertyname} [=,<,>,!=,>=,<=] 'value'"
compound queries are supported as ${query} [and,or] ${query}
ordering for compound queries is achieved through use of bracket groups
"select ${classname} where ($propertyname} [=,<,>,!=,>=,<=] 'value' [and,or] ${propertyname} [=,<,>,!=,>=,<=] 'value') [and,or] ${propertyname} [=,<,>,!=,>=,<=] 'value'"
multiclass queries are of the form
select ${classname} as A, ${classname} as B where A.${propertyname} [=,<,>,!=,>=,<=] 'value' [and.or] B.${propertyname} [=,<,>,!=,>=,<=] 'value'"
All values are created using a reflective String constructor .So if you want to Compare an Integer(22) you just specify
value=22 - the value type is chosen based on the declared type of the field.
For primitive wrappers in the JVM the propertyname is always the literal string 'VALUE' (case insensitive)
java.lang.String.class,
java.lang.Integer.class,
java.lang.Double.class,
java.lang.Float.class,
java.lang.Long.class,
java.lang.Short.class,
java.math.BigInteger.class,
java.math.BigDecimal.class,
java.util.Date.class,
java.net.URI.class
For example to query an integer you would write
select java.lang.Integer where VALUE = 20
or
select java.lang.Integer as i where i.VALUE =20
Dates are constructed using the default encoding of the JVM. So a UK encoding would be:
select java.util.Date where value <='4/10/1901 00:00:00'
For user defined classes in order to query the property type must have a String constructor and must
implement equals and hashCode correctly.
author: Steve Woodcock version: 1.0 |