FAQ
Thanks everyone for your help with the multi-user stuff!!

I managed to implement a hybrid system where individual totals are
calculated in the getXXX method and whenever multiple totals are requested
at once (e.g. in a table) then it loads them with an EJBQL query.

Now I just have to figure out to make a total by summing either column 1 if
set, and otherwise column 2, in SQL:

*SELECT *t.orderNumber, *SUM*(*COALESCE*(t.column1, t.column2)) *FROM *table
t *GROUP BY* t.orderNumber;

But that's not possible in EJBQL, right? Is there a way to extend the
EJBQL? Also, is there a grammar available of the EJBQL?

Mark

Search Discussions

  • Andrus Adamchik at Nov 10, 2014 at 7:10 am

    *SELECT *t.orderNumber, *SUM*(*COALESCE*(t.column1, t.column2)) *FROM *table
    t *GROUP BY* t.orderNumber;

    But that's not possible in EJBQL, right?
    Not to my knowledge. So SQLTemplate (or 3.2/4.0 SQLSelect) is probably needed here.
    Is there a way to extend the EJBQL?
    Not easily.
    Also, is there a grammar available of the EJBQL?

    Looks like it is missing from the docs, but it is available in Git:

    https://github.com/apache/cayenne/blob/master/cayenne-server/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt

    Andrus
    On Nov 7, 2014, at 8:31 PM, Mark Stobbe wrote:

    Thanks everyone for your help with the multi-user stuff!!

    I managed to implement a hybrid system where individual totals are
    calculated in the getXXX method and whenever multiple totals are requested
    at once (e.g. in a table) then it loads them with an EJBQL query.

    Now I just have to figure out to make a total by summing either column 1 if
    set, and otherwise column 2, in SQL:

    *SELECT *t.orderNumber, *SUM*(*COALESCE*(t.column1, t.column2)) *FROM *table
    t *GROUP BY* t.orderNumber;

    But that's not possible in EJBQL, right? Is there a way to extend the
    EJBQL? Also, is there a grammar available of the EJBQL?

    Mark

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 7, '14 at 5:32p
activeNov 10, '14 at 7:10a
posts2
users2
websitecayenne.apache.org

2 users in discussion

Mark Stobbe: 1 post Andrus Adamchik: 1 post

People

Translate

site design / logo © 2021 Grokbase