You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Steve Stock <st...@technolope.org> on 2002/03/02 08:48:41 UTC

Decoupled torque 3.0-dev and reading postgresql booleans doesn't work

I am using the decoupled torque 3.0-dev (CVS from 2002-02-24) and
postgresql 7.2.  My database has several boolean columns that are
configured as BOOLEANCHAR types in the database map.  I receive no errors
when reading objects from the database but all of my boolean values were
false irrespective of the value in the database.

Let me start by saying that I don't fully understand how everything fits
together between the database and the object.  I do know that in the Peer
class when a new object is being populated from the database boolean
values from the database are compared with "Y".  If this comparison is
true the boolean is true, otherwise the boolean is false.  The problem
is that the value from the database that is being compared isn't "Y" or
"N" it is "true" or "false".  Obviously the new object will never have a
true boolean value.  Changing the comparison to use "true" instead of "Y"
fixes the problem.

I have only been using torque for a few days so I have no idea if this
has ever worked or if some recent change caused it to stop working.

I haven't tried saving an object with a boolean yet, but I suspect it
will work correctly because postgresql is liberal in the boolean values
that it will accept.

Steve Stock
steve@technolope.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>