You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Jarnot Voytek Contr AU HQ/SC <Vo...@MAXWELL.AF.MIL> on 2003/11/22 02:41:23 UTC

Selecting with prepared statements

  So it seems that using prepared statements for selects is not supported
'out-of-the-box' with Torque.

  However, it appears as simple as changing all calls to BasePeer.doSelect
in one's Base*Peer classes to BasePeer.doPSSelect will do the trick.

  This provides a false sense of hope, however.  Because the minute one
tries to do an "IS NULL" comparison (by passing a null object to
Criteria.add) the SQL generated is no longer valid.

  I've fixed the Criteria.Criterion.appendPsTo method to generate "=?" as
usual, except when the value is null it generates "IS NULL".  This solution
seems too easy - have I missed something?  Is this a valid fix?

--
Voytek Jarnot

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org