group by & tabular data is it possible ??

  • giluka

    giluka - 2013-06-04

    Hi all,
    is there a possibility to use "group by" with aggregate function in setting condition of a tabular data ?
    For example, in setting properties, i would specify something like: "field1, field2, sum(field3)" and in condition: "group by field1, field2"

  • Javier Paniza

    Javier Paniza - 2013-06-06

    Hi Giluka,

    group by is supported by JPAQL, however the @Tab property has not a place to define it, you only have condition and order. Maybe, we have to enhance @Tab in order to support this feature.

    In the meantime you can try this alternative:

    @Tab(properties="e.field1, e.field2, sum(e.field3)", condition="1=1 group by e.field1, e.field2)

    If it does not work try to put the complete select in baseCondition.

    I hope it works. If not we always have the option of creating a DB view and overwriting XAVA_SEARCH_ACTION.

    Help others in this forum as I help you.
    Need more help? Get OpenXava professional support.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks