db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giulio Vezzelli" <giulio.vezze...@infolog.it>
Subject R: Problems with Criteria and ORDER BY
Date Thu, 23 Oct 2003 12:22:00 GMT
Sorry, I missed the "dot exception" part of your first mail.

Try this thing, may screw up everything but...
Name the column as COUNT(*) AS 'TABLENAME.COUNTCOLUMN'

Using the ', it will force the dot in the name of the column...
Then the orderby would be 'TABLENAME.COUNTCOLUMN'

It depends on which kind of check does Torque do on the column names...

Giulio Vezzelli
Infolog S.r.l.
Via Alfieri, 28
Modena - 41100
Telefono : +39-059-822446
Sito web : http://www.infolog.it
E-mail : giulio.vezzelli@infolog.it
 


> -----Messaggio originale-----
> Da: Michael Burschik [mailto:Burschik@lotto-berlin.de] 
> Inviato: giovedì 23 ottobre 2003 14.05
> A: 'Apache Torque Users List'
> Oggetto: AW: Problems with Criteria and ORDER BY
> 
> 
> > -----Urspr√ľngliche Nachricht-----
> > Von: Giulio Vezzelli [mailto:giulio.vezzelli@infolog.it]
> > Gesendet: Donnerstag, 23. Oktober 2003 12:48
> > An: Apache Torque Users List
> > Betreff: R: Problems with Criteria and ORDER BY
> > 
> > 
> > I think you can add the count column to the select query as
> > Maurice suggested, but adding "AS COUNTCOLUMN" to the count 
> > string, and then use the addAscendingOrderByColumn method 
> > with "COUNTCOLUMN" as the parameter. Don't know if it will 
> > really work, just a suggestion...
> 
> This is what I first tried, and it does not work. As I tried 
> to explain in my first mail, BasePeer.createQuery throws an 
> exception because the name of the column (COUNTCOLUMN in your 
> example) does not contain a dot. But of course I can not use 
> TABLENAME.COUNTCOLUMN either, since the table does not have a 
> column with that name.
> 
> Regards
> 
> Michael Burschik
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message