db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tulsi Das <quixote_...@yahoo.com>
Subject Re: Problems with Criteria and ORDER BY
Date Thu, 23 Oct 2003 12:36:59 GMT
I had the exact same problem, and someone on the list solved it. You
will need to patch BasePeer and rebuild Torque.

As in my 3.0.2 dist:

(line aprox 1230)
if (aliases.containsKey(alias)) {
  orderByClause.add(orderByColumn);
}
else {
if (orderByColumn.indexOf('.') == -1) {
  throwMalformedColumnNameException(
  .
  .
  .
}

e-mail and I can send you the patched jar (remind it is v 3.0.2)


 --- Michael Burschik <Burschik@lotto-berlin.de> escribió: 
> The BasePeer.createQuery method checks whether the order by column
> contains
> a "." and throws an exception if it does not. This is not a very good
> idea.
> First of all, it does not catch non-existent column names that happen
> to
> include a ".". And secondly, it does not allow for the perfectly
> legal use
> of a column alias in the order by statement, e.g. "select somecolumn,
> count(*) as count from mytable order by count". Is there another way
> to get
> this, apart from the obvious solution of building the statement
> manually?
> 
> Regards
> 
> Michael Burschik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>  

------------
Internet GRATIS es Yahoo! Conexión
4004-1010 desde Buenos Aires. Usuario: yahoo; contraseña: yahoo
Más ciudades: http://conexion.yahoo.com.ar

---------------------------------------------------------------------
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