Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 77485 invoked from network); 7 Oct 2003 21:32:11 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 Oct 2003 21:32:11 -0000 Received: (qmail 26761 invoked by uid 500); 7 Oct 2003 21:31:40 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 26722 invoked by uid 500); 7 Oct 2003 21:31:40 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 26670 invoked from network); 7 Oct 2003 21:31:40 -0000 Received: from unknown (HELO web12405.mail.yahoo.com) (216.136.173.132) by daedalus.apache.org with SMTP; 7 Oct 2003 21:31:40 -0000 Message-ID: <20031007213146.60131.qmail@web12405.mail.yahoo.com> Received: from [200.49.91.74] by web12405.mail.yahoo.com via HTTP; Tue, 07 Oct 2003 18:31:46 ART Date: Tue, 7 Oct 2003 18:31:46 -0300 (ART) From: =?iso-8859-1?q?Tulsi=20Das?= Subject: Alias order by problem... To: torque-user@db.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, using Torque with MySQL I want to do an "order by" using some alias column and not a table column. That is, something like this: SELECT actividad.*, MATCH (actividad.ACTIVIDAD) AGAINST ('futbol') AS score FROM actividad WHERE MATCH (actividad.ACTIVIDAD) AGAINST ('futbol') order by score desc that is, using full text seach, sort by the score of that result. To achieve that, I use the following code: String matchString = "MATCH ("+ActividadPeer.ACTIVIDAD+") AGAINST (\'"+texto+"\')"; Criteria crit = new Criteria(); crit.add(ActividadPeer.ACTIVIDAD, (Object)matchString, Criteria.CUSTOM); crit.addAsColumn("score", matchString); crit.addDescendingOrderByColumn("score"); List actividades = ActividadPeer.doSelect(crit); If I comment the addDescendingOrderByColumn line, everything goes well and the full text goes ok, but when trying to do the order by, I get the following error: org.apache.torque.TorqueException: Malformed column name in Criteria order by: 'score DESC' is not of the form 'table.column' Now... I know it what it means, but I don�t want a table.column form, since it�s an alias! Any input on the subject will be much appreciated thanks Tulsi ------------ 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