Re: Bit and Boolean

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Dec 08 2003 - 22:00:56 EST

  • Next message: Jim Menard: "Re: Bit and Boolean"

    On Dec 8, 2003, at 7:47 PM, Andrus Adamchik wrote:
    > On Dec 8, 2003, at 1:58 PM, Jim Menard wrote:
    >
    > Hi Jim,
    >
    > Your code looks correct.
    >
    > I just realized that we did not have test cases for the BIT values, so
    > I created one and ran it on Oracle, MySQL and PostgreSQL. Everything
    > worked fine on the first two, but PostgreSQL blew up with the error
    > similar to what you describe. Looks like a PG JDBC driver doesn't
    > support boolean to bit conversions. Even though this seems like a
    > driver problem, I opened a bug:
    >
    > http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-55

    My original assessment of the problem was not entirely correct. What
    happened here is the mismatch between java.sql.Types.BIT and Postgres
    "bit" types. Postgres "bit" is in fact a "bit string", so it is not the
    same things as java.sql.Types.BIT. I changed default mapping used by
    Cayenne to generate PostgreSQL tables. Now if an attribute is a BIT, it
    will result in a Postgres "boolean" column, that works with Java
    boolean values.

    Cayenne version that contains this fix can be downloaded from here:

    http://objectstyle.org/downloads/cayenne/patched/cayenne-src-1.0.x-
    dev.tar.gz

    And of course, DB schema will have to be regenerated.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Dec 08 2003 - 22:01:03 EST