db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ant...@di.uoa.gr
Subject Bit columns in Mysql 5
Date Sun, 19 Feb 2006 14:53:25 GMT
Hello,

  a couple of months ago, we had discussed the problem in mysql 5 with the bit
type (the jdbc driver incorrectly reported the type as String). A couple of bug
fixes were submitted and one of them was included in the new beta version of
connector/j 5.0 (http://dev.mysql.com/downloads/connector/j/5.0.html).
  I tried the new version, but the exact same problem persisted (exception when
inserting new boolean values and always returning false for bit values already
in database)...
  I searched the source code of torque and village and came up with a
torque-specific solution (actually a village-specific):

  in file com\workingdogs\village\Column.java add the following lines in line 178:

   if (this.columnTypeName.toLowerCase().equals("bit"))
       this.columnType = Types.BIT;

  in file com\workingdogs\village\Value.java replace the lines 1573-1574 with
the following:

        return (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("t") ||
value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("y") ||
value.equals("1") || value.charAt(0) == 1);

I don't know if it's generic enough, but it works for me ;)

Antonis.

PS. I am reffering to village version 2.0 used in torque 3.2
(http://www.softwareforge.de/releases/village/distributions/) 


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


Mime
View raw message