Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 55982 invoked from network); 6 Oct 2008 17:11:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Oct 2008 17:11:53 -0000 Received: (qmail 5855 invoked by uid 500); 6 Oct 2008 17:11:51 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 5843 invoked by uid 500); 6 Oct 2008 17:11:51 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 5832 invoked by uid 99); 6 Oct 2008 17:11:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 10:11:51 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [12.184.141.100] (HELO ABmail.activx.com) (12.184.141.100) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 17:10:49 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: ORDER BY and torque generated column names Date: Mon, 6 Oct 2008 10:11:58 -0700 Message-ID: In-Reply-To: <48EA01BC.3030103@sharp.fm> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ORDER BY and torque generated column names thread-index: Acknrb1Z5O5iHEl4SSe2hTmoNnG+awAKHbVw From: "Manaster, Carl" To: "Apache Torque Users List" X-Virus-Checked: Checked by ClamAV on apache.org Hi, Graham, > Am I doing something wrong in the following code? >=20 > criteria.addJoin(BPeer.POLICYDETAIL_ID,=20 > APeer.POLICYDETAIL_ID);=20 > criteria.addDescendingOrderByColumn(BPeer.UNDERWRITING_YEAR); > criteria.addDescendingOrderByColumn(APeer.POLICYDETAIL_ID); > APeer.doSelect(criteria); I think the issue is that when you ask APeer to select, it will select only the fields from a; it's telling you that you can't ORDER BY b.underwriting_year because that is not one of the columns in a. You could specify with addSelectColumn() exactly which columns you want to select and use BasePeer.doSelect() instead of APeer.doSelect, but that will give you com.workingdogs.village Records rather than a's, if that matters. Peace, --Carl --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org