cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: EJBQL parser
Date Mon, 11 Jul 2011 18:25:20 GMT
Sigh... I feel like we should've used common sense and built our own QL based on EJBQL/JPQL
instead of blindly following the JPA spec. Which among other things says "The Java Persistence
query language includes [...] built-in functions, which may be used in the WHERE or HAVING
clause of a query." So no ORDER BY in this list :-/

>  I searched the code but those 10k lines are quite a challenge.

You betcha. 

We should prolly add it. Hope most DB's support it.


On Jul 11, 2011, at 5:36 PM, Marek Šabo wrote:
> Hi all,
> I was trying to push a query through parser today and it didn't make it.
> "SELECT stt FROM SubTaskType stt ORDER BY ABS(stt.code) ASC"
> Exception is below, my question being whether it is correct behaviour or a bug. I know
mysql allows such syntax and oracle too (it allows numeric sorting of strings). I searched
the code but those 10k lines are quite a challenge.
> Regards,
> Marek
> Caused by: org.apache.cayenne.ejbql.parser.ParseException: Encountered " "ABS" "ABS ""
at line 1, column 42.
> Was expecting one of:
>    "db:" ...
>        at org.apache.cayenne.ejbql.parser.EJBQL.generateParseException(
>        at org.apache.cayenne.ejbql.parser.EJBQL.jj_consume_token(
>        at org.apache.cayenne.ejbql.parser.EJBQL.path(
>        at org.apache.cayenne.ejbql.parser.EJBQL.orderby_item(
>        at org.apache.cayenne.ejbql.parser.EJBQL.orderby_clause(
>        at org.apache.cayenne.ejbql.parser.EJBQL.select_statement(
>        at org.apache.cayenne.ejbql.parser.EJBQL.parseQuery(
>        at org.apache.cayenne.ejbql.parser.EJBQL$EJBQLDefaultParser.compile(

View raw message