Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7067D7DE for ; Thu, 12 Jul 2012 20:35:52 +0000 (UTC) Received: (qmail 52718 invoked by uid 500); 12 Jul 2012 20:35:52 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 52673 invoked by uid 500); 12 Jul 2012 20:35:52 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 52664 invoked by uid 99); 12 Jul 2012 20:35:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 20:35:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [217.24.207.26] (HELO mail.seitenbau.net) (217.24.207.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2012 20:35:45 +0000 Received: from www.seitenbau.net ([192.168.15.18]:15072) by mail.seitenbau.net with esmtp (Exim 4.76) (envelope-from ) id 1SpQ6c-0001C2-2W for torque-dev@db.apache.org; Thu, 12 Jul 2012 22:35:22 +0200 X-CTCH-RefID: str=0001.0A0B020B.4FFF350A.013A,ss=1,re=0.000,fgs=0 Sensitivity: MIME-Version: 1.0 Importance: Normal X-Priority: 3 (Normal) In-Reply-To: <34152451.post@talk.nabble.com> References: <34152451.post@talk.nabble.com>, <34152440.post@talk.nabble.com> Subject: Re: Criteria object doesn't generate SQL. From: Thomas Fox To: torque-dev@db.apache.org X-MIMETrack: MIME-CD by Notes Server on www/seitenbau(Release 8.5HF467 | May 15, 2009) at 07/12/2012 22:35:22, MIME-CD complete at 07/12/2012 22:35:22, Serialize by Router on www/seitenbau(Release 8.5HF467 | May 15, 2009) at 07/12/2012 22:35:22 Message-ID: Date: Thu, 12 Jul 2012 22:35:22 +0200 X-Mailer: Lotus Domino Web Server Release 8.5HF467 May 15, 2009 Content-type: text/plain; charset=US-ASCII Which Torque version are you using ? Thomas -----Anthony Zepezauer wrote: ----- >To: torque-dev@db.apache.org >From: Anthony Zepezauer >Date: 12.07.2012 08:22PM >Subject: Re: Criteria object doesn't generate SQL. > > some small edits: I'm having a very confusing problem, hoping >somebody here can shed some light. Here's the snippet where it >occurs: Criteria tCrit = getCriteria(); >tCrit.addIn(TRetailerCouponPeer.RETAILER_COUPON_ID, >retailerCouponIds); >tCrit.addJoin(TRetailerCouponPeer.RETAILER_COUPON_ID, >ArchTUserRetailerCouponPeer.RETAILER_COUPON_ID); >tCrit.add(ArchTUserRetailerCouponPeer.USER_RETAILER_ID, >retailerCardInfo.getId()); >tCrit.add(TRetailerCouponPeer.CHAINED_TO_COUPON_ID, (Object) null, >Criteria.ISNULL); >tCrit.addJoin(TRetailerCouponPeer.RETAILER_COUPON_ID, >TRetailerCouponMetadataPeer.RETAILER_COUPON_ID); >tCrit.addDescendingOrderByColumn(ArchTUserRetailerCouponPeer.REDEEM_D >ATE); >tCrit.addDescendingOrderByColumn(ArchTUserRetailerCouponPeer.TAKE_DAT >E); mLogger.info("SQL: " ["+tCrit+"]"); try { return >ArchTUserRetailerCouponPeer.doSelectJoinTRetailerCouponAndTRetailerCo >uponMetadata(tCrit); } catch (TorqueException e) { >mLogger.error("Unable to select user coupons", e); returnnull; } > when I run this code on my local build, it runs fine, and >the output from the log statement looks like this: SQL: >[Criteria:: >arch_t_user_retailer_coupon.USER_RETAILER_ID<=>arch_t_user_retailer_c >oupon.USER_RETAILER_ID=20067: >t_retailer_coupon.CHAINED_TO_COUPON_ID<=>t_retailer_coupon.CHAINED_TO >_COUPON_ID IS NULL : Current Query SQL (may not be complete or >applicable): SELECT FROM arch_t_user_retailer_coupon, >t_retailer_coupon, t_retailer_coupon_metadata WHERE >arch_t_user_retailer_coupon.USER_RETAILER_ID=20067 AND >t_retailer_coupon.CHAINED_TO_COUPON_ID IS NULL AND >t_retailer_coupon.RETAILER_COUPON_ID=arch_t_user_retailer_coupon.RETA >ILER_COUPON_ID AND >t_retailer_coupon.RETAILER_COUPON_ID=t_retailer_coupon_metadata.RETAI >LER_COUPON_ID ORDER BY arch_t_user_retailer_coupon.REDEEM_DATE DESC, >arch_t_user_retailer_coupon.TAKE_DATE DESC] But, when I >check in my code, build and run it on a shared DEV server, the output >looks like this: SQL: [Criteria:: >arch_t_user_retailer_coupon.USER_RETAILER_ID<=>arch_t_user_retailer_c >oupon.USER_RETAILER_ID=20067: >t_retailer_coupon.CHAINED_TO_COUPON_ID<=>t_retailer_coupon.CHAINED_TO >_COUPON_ID IS NULL : Current Query SQL (may not be complete or >applicable): ] Note that the entire 'Current Query SQL' is >missing. And then the actual join fails. (I can post the stack >trace if desired, but IMHO it's irrelevant because the problem has >already occurred - the join is failing because there's no SQL to >execute.) SVN confirms that the code is identical in both cases, >including schema.xml. The DB being connected to is the same in both >cases. So, can anybody shed any light on why the Criteria object >would generate the SQL in one case and not the other? Again, I can >send the stack trace or any other info that might be helpful. -- >View this message in context: >http://old.nabble.com/Criteria-object-doesn%27t-generate-SQL.-tp34152 >440p34152451.html Sent from the Apache DB - Torque Dev mailing list >archive at Nabble.com. >--------------------------------------------------------------------- >To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For >additional commands, e-mail: torque-dev-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org