db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarnot Voytek Contr AU HQ/SC <Voytek.Jar...@MAXWELL.AF.MIL>
Subject Selecting with prepared statements
Date Sat, 22 Nov 2003 01:41:23 GMT
  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


Mime
View raw message