Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 20147 invoked from network); 19 Oct 2007 22:14:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Oct 2007 22:14:33 -0000 Received: (qmail 6272 invoked by uid 500); 19 Oct 2007 22:14:20 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 6258 invoked by uid 500); 19 Oct 2007 22:14:20 -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 6247 invoked by uid 99); 19 Oct 2007 22:14:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 15:14:20 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [70.103.251.107] (HELO scalix0.corp.dotster.net) (70.103.251.107) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2007 22:14:25 +0000 Received: from scalix0.corp.dotster.net (localhost.localdomain [127.0.0.1]) by scalix0.corp.dotster.net (8.13.1/8.13.1) with ESMTP id l9JME4eH032595 for ; Fri, 19 Oct 2007 15:14:04 -0700 Received: from scalix0.corp.dotster.net (root@localhost) by scalix0.corp.dotster.net (8.13.1/8.13.1/Submit) with ESMTP id l9JME4g0032574 for ; Fri, 19 Oct 2007 15:14:04 -0700 Received: from localhost.localdomain (dotster-vip2.corp.dotster.net 70.103.251.2) by scalix0.corp.dotster.net (Scalix SMTP Relay 10.0.1.3) via ESMTP; Fri, 19 Oct 2007 15:14:04 -0700 (PDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id l9JME3uH004066 for ; Fri, 19 Oct 2007 15:14:03 -0700 Received: (from brmiller@localhost) by localhost.localdomain (8.13.5.20060308/8.13.5/Submit) id l9JME2Lv004065 for torque-user@db.apache.org; Fri, 19 Oct 2007 15:14:02 -0700 Date: Fri, 19 Oct 2007 15:14:02 -0700 From: "Brendan Miller" To: Apache Torque Users List Message-ID: <20071019221402.GA3671@localhost.localdomain> In-Reply-To: <20070418230058.GA23868@localhost.localdomain> References: <20070418225533.GA23815@localhost.localdomain> References: <20070418230058.GA23868@localhost.localdomain> Subject: Re: Wrong SQL generation from Criteria x-scalix-Hops: 1 x-scalix-Authenticated-Sender: brmiller@dotster.com at 70.103.251.2 User-Agent: Mutt/1.5.11 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org > > > > > > But this still leaves me a "column ambiguously defined" error when using > > > addJoin(): > > > > > > crit.addJoin(TableAPeer.ColumnX, TableBPeer.ColumnG); > > > crit.addAscendingOrderByColumn(TableBPeer.ColumnQ); > > > crit.addAscendingOrderByColumn(TableBPeer.ColumnR); > > > List tableBs = TableBPeer.doSelect(crit); > > > > > > generates > > > > > > SELECT <..TableB fields> FROM TABLE_A, TABLE_B, DBSCHEMA.TABLE_B WHERE TABLE_A.COLUMN_X=TABLE_B.COLUMN_G ORDER BY TABLE_B.COLUMN_Q ASC, TABLE_B.COLUMN_R ASC > > > > > > Where does the extra DBSCHEMA.TABLENAME come from? I'm getting this again (wrote some more code like the above), this time without any addAscending...: Criteria crit = new Criteria(); crit.addJoin(TransactionPeer.ORDER_ID, OrderPeer.ID); crit.add(TransactionPeer.ACCT_ID, account.getID()); List orders = OrderPeer.doSelect(crit); generates SELECT <..ORDERS columns..> FROM TRANSACTION, ORDERS, DBSCHEMA.ORDERS, DBSCHEMA.TRANSACTION WHERE TRANSACTION.ORDER_ID=ORDERS.ID AND TRANSACTION.ACCT_ID= ? It seems that SQLBuilder.processJoins does not add the full table names, and SQLBuilder.processCriterions does. What am I doing wrong? Brendan --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org