Re: [enhydra] Problem with aggregate function made via DODS
Daniel <[email protected]> Wed, 27 Apr 2005 11:59:25 +0200
| Newsgroups | gmane.comp.java.enhydra.general |
|---|---|
| Message-ID | <[email protected]> |
Sinisa Milosevic wrote: >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" <[email protected]> >To: <[email protected]> >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 [email protected] >> >> >mailing list. > > >>To unsubscribe: mailto:[email protected] >>For general help: mailto:[email protected]?subject=help >>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >> >> >> > > > > >------------------------------------------------------------------------ > > >-- >You receive this message as a subscriber of the [email protected] mailing list. >To unsubscribe: mailto:[email protected] >For general help: mailto:[email protected]?subject=help >ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > Yes, I have done it accordinglly. Thank you. It really works. But what happens if I upgrade enhydra or dods to a higher version. I will lose all of my stuff. So is there a way how to separate my code from DODS standard code. (I mean if my methods could be in a separated file so they would be imported to main writeFileHeaderQuery.xls only). Or something like that ? Thank you for your patiance.
message.footer
(text/plain, 275 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws