PostgeSQL problems (Boolean vs Bit)

From: Doychi (doychi-list..oychi-dina.ath.cx)
Date: Wed Nov 09 2005 - 00:37:29 EST

  • Next message: Andrus Adamchik: "Re: PostgeSQL problems (Boolean vs Bit)"

    Hi All,

    I seem to be having some problems with PostgeSQL (8.1) and Cayenne 1.2(M7).
     I get the error (more details give below):

    java.sql.SQLException: ERROR: column "active" is of type bit but expression
    is of type boolean

    when I try to add a new user to my user table.

    CREATE TABLE users
    (
      active bit(1) NOT NULL,
      administrator bit(1) NOT NULL,
      email varchar(128) NOT NULL,
      id int4 NOT NULL,
      name varchar(50) NOT NULL,
      "password" char(256) NOT NULL,
      CONSTRAINT users_pkey PRIMARY KEY (id)
    )

    I've set the modeler's db type for active and administrator to "BIT", and
    the Java type to "java.lang.Boolean". Is this correct?

    I did notice that there is an old closed bug in JIRA (http://objectstyle.org/jir
    a/secure/ViewIssue.jspa?key=CAY-55) that sounds like the same problem. Did
    some
    thing creep back in? If so is there a file I can modify to fix this
    problem unt
    il the next mile stone?

    PS: I love Cayenne and am currently working on a project with Cayenne and
    Click and except for some teething problems I'm loving it.

    java.sql.SQLException: ERROR: column "active" is of type bit but expression
    is of type boolean
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecut orImpl.java:1471)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl .java:1256)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:1 75)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statemen t.java:389)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc 2Statement.java:330)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2St atement.java:282)
        at org.objectstyle.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(Ba tchAction.java:212)
        at org.objectstyle.cayenne.access.jdbc.BatchAction.performAction(BatchAction .java:117)
        at org.objectstyle.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQuery Action.java:95)
        at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:310) at org.objectstyle.cayenne.access.DataContextCommitAction.commit(DataContext CommitAction.java:181)
        at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java :950)

    --
    Doychi
    spdoychia..oychi-dina.ath.cx
    



    This archive was generated by hypermail 2.0.0 : Wed Nov 09 2005 - 00:37:59 EST