Hi guys,

After some further analysis of the new query expressions API I figured out how to get the more natural "A and B" rather than "and(A,B)" syntax going. It basically looks like this:
ge( person.yearOfBirth(), 1900 ).
and( eq( person.placeOfBirth().get().name(), "Penang" ) )

Internally this is converted to and(A,B). If there are several "and" in a row they are compacted into one "and", simlarly with "or".

The "and()" and "or()" methods are in a common baseclass for all expression operators, so is always available. I hope this will make it easier to read queries.

The precedence of operators is given reasonably naturally by how they are used. So this:
A.and(B).or(C)
=
or(and(A,B),C)
while this:
A.and(B.or(C))
=
and(A,or(B,C))

This syntactic sugar does not have to be understood by EntityFinders.

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to