Matthew Cooper wrote:

> Have you had any joy trying to fix this problem at all? We are getting
> it too and it doesn't look like anyone has replied to you with the magic
> answer!
> 
> Regards, Matty
> 
> Matthew Cooper
> Nuix
> 
> 
> 

I finally, and after some messing around, found the solution in the  
jaws type mapping. It would seem boolean can be mapped to postgresql  
BOOL through jdbc VARCHAR. I don't know why, but it works all right on  
my system!

 Here is the code I added to my jaws.xml

  <type-mappings>
      <type-mapping>
          <name>PostgreSQL</name>
          <mapping>
              <java-type>java.lang.Boolean</java-type>
              <jdbc-type>VARCHAR</jdbc-type>
              <sql-type>BOOL</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Byte</java-type>
              <jdbc-type>TINYINT</jdbc-type>
              <sql-type>INT2</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Short</java-type>
              <jdbc-type>SMALLINT</jdbc-type>
              <sql-type>INT2</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Integer</java-type>
              <jdbc-type>INTEGER</jdbc-type>
              <sql-type>INT4</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Long</java-type>
              <jdbc-type>BIGINT</jdbc-type>
              <sql-type>INT8</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Float</java-type>
              <jdbc-type>FLOAT</jdbc-type>
              <sql-type>FLOAT(7)</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Double</java-type>
              <jdbc-type>DOUBLE</jdbc-type>
              <sql-type>FLOAT8</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Character</java-type>
              <jdbc-type>CHAR</jdbc-type>
              <sql-type>CHAR(1)</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.String</java-type>
              <jdbc-type>VARCHAR</jdbc-type>
              <sql-type>TEXT</sql-type>
          </mapping>
          <mapping>
              <java-type>java.sql.Date</java-type>
              <jdbc-type>DATE</jdbc-type>
              <sql-type>DATE</sql-type>
          </mapping>
          <mapping>
              <java-type>java.sql.Time</java-type>
              <jdbc-type>TIME</jdbc-type>
              <sql-type>TIME</sql-type>
          </mapping>
          <mapping>
              <java-type>java.sql.Timestamp</java-type>
              <jdbc-type>TIMESTAMP</jdbc-type>
              <sql-type>TIMESTAMP</sql-type>
          </mapping>
          <mapping>
              <java-type>java.lang.Object</java-type>
              <jdbc-type>JAVA_OBJECT</jdbc-type>
              <sql-type>OID</sql-type>
          </mapping>
  </type-mapping>
  </type-mappings>



>  I've been suffering from a silly problem for about two months, and 
> I'm afraid it's probably due to a stupid thing which I can't spot (you 
> get blind to your own code after a while...).
> 
>  It seems the boolean values read from my posgres database are allways 
> false, whatever the actual state they are in. If modified they get 
> written back all right, and then their value is consistant... until I 
> restart jboss.
> 
>  I know there was some trouble with booleans & postgres some time ago 
> (I looked closely in the mailing lists), but I'm quite sure my problem 
> doesn't arise from my 'jaws.xml'. This file doesn't contain any type 
> mapping anyway (jBoss uses its own 'standardjaws.xml').
> 



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to