On 30/01/12 9:12 PM, Durchholz, Joachim wrote:
giving
new QualifierList ()
.like("name", "b%")
.or (
new Greater("age", 23)
.less("age", 27)
)
I am not sure you have achieved any more readability over the plain string
version. Compare:
new SelectQuery().query("age < 27")
new SelectQuery().less("age", 27)
Which parameter is supposed to be less than which? At any rate a more interesting
approach might be to implement typesafe Object Attributes such as
Artist.AGE<Integer>:
less(ObjAttribute<T>, Object<T>)
A more radical approach was also discussed before. Something like (from memory):
new SelectQuery().and(Artist.AGE.under(23))
It reads nicely and can be made type-safe, but is a bit messy in that it moves
many Expression methods into the ObjAttribute class.
Ari
--
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A