Mail Archive Home | enhydra List | April 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Hi,
In DODS templates (xxxQuery class-writeFileHeaderQuery), you will find
selectCount method. You can use similar scenario and extend your templates
and generate selectSum method for your purposes.
I hope it helps.
Regards,
Sinisa
----- Original Message -----
From: "Daniel" <daniel.guryca@xxxxxxxxxx>
To: <enhydra@xxxxxxxxxxxxx>
Sent: Friday, April 22, 2005 12:44 PM
Subject: [enhydra] Problem with aggregate function made via DODS
> I have problem with aggregate function made via DODS.
> In DODS mailing list/forum has nobody helped me.
>
> If I print final SQL - via query.debug() -
> I get - SELECT sum(amount) FROM Person - which is OK.
> But dbQuery.next always returns null. Why?
> How could I implement these aggregate functions if this is not the
right way.
>
> My code: DBQuery dbQuery = null;
> QueryBuilder query = null;
> Object obj = null;
>
> PersonQuery origQuery = new PersonQuery();
> query = origQuery.getQueryBuilder();
> query.setSelectClause(" sum(amount) as \"suma\" ");
>
> dbQuery = PersonDO.createQuery();
> query.debug();
>
> dbQuery.query(query);
> obj = dbQuery.next();
>
> I use Enhydra 5.1.15.
>
> Thank you for your help.
>
>
>
----------------------------------------------------------------------------
----
>
> --
> You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx
mailing list.
> To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.