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 RE: Selecting with prepared statements
Date Mon, 24 Nov 2003 16:04:27 GMT
Along these same lines, I've changed Criteria and BasePeer to support
java.sql.Timestamp as a parameter type for prepared statements.

I'd still like to hear about it if people think I'm missing something
obvious; otherwise, should I post a patch here?  Or is this a topic no one
else cares about?

Voytek Jarnot
Quantum materiae materietur marmota monax si marmota monax materiam possit

> -----Original Message-----
> From: Jarnot Voytek Contr AU HQ/SC 
> Sent: Friday, November 21, 2003 7:41 PM
> To: 'torque-dev@db.apache.org'
> Cc: Jarnot Voytek Contr AU HQ/SC
> Subject: 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

View raw message