You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by T E Schmitz <ma...@numerixtechnology.de> on 2004/05/03 13:55:20 UTC

Postgresql - invalid WHERE clause for BOOL columns generated (adapter fix)

Hello,

I just hit upon a problem with Postgresql columns of type bool.

Torque generates invalid SQL for bool comparisons:
generates   : WHERE xyz=0
needs to be : WHERE xyz=FALSE (or WHERE xyz='0')

The fault is in the adapter. I amended the adapter as follows and it 
works fine now:
public String getBooleanString(Boolean b)
{
   //return (b == null) ? "0" : (Boolean.TRUE.equals(b) ? "1" : "0");
   return (b == null) ? "NULL" : (Boolean.TRUE.equals(b) ? "TRUE" : 
"FALSE");
}


-- 


Regards,

Tarlika Elisabeth Schmitz

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