db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject Re: Criteria object doesn't generate SQL.
Date Thu, 12 Jul 2012 20:35:22 GMT

Which Torque version are you using ?


-----Anthony Zepezauer wrote: -----

>To: torque-dev@db.apache.org
>From: Anthony Zepezauer <azepezauer@you.net>
>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:  <code> Criteria tCrit = getCriteria();
>tCrit.add(TRetailerCouponPeer.CHAINED_TO_COUPON_ID, (Object) null,
>E);          mLogger.info("SQL: " ["+tCrit+"]");  try { return
>uponMetadata(tCrit); } catch (TorqueException e) {
>mLogger.error("Unable to select user coupons", e); returnnull; }
></code>  when I run this code on my local build, it runs fine, and
>the output from the log statement looks like this:  <code> SQL:
>_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
>LER_COUPON_ID ORDER BY arch_t_user_retailer_coupon.REDEEM_DATE DESC,
>arch_t_user_retailer_coupon.TAKE_DATE DESC] </code>  But, when I
>check in my code, build and run it on a shared DEV server, the output
>looks like this:  <code> SQL: [Criteria::
>_COUPON_ID IS NULL :   Current Query SQL (may not be complete or
>applicable): ] </code>  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:
>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

View raw message