Hi all,
i'm currently using jBoss 2.2.1 and postgreSQL 7.0.1. I deploy my bean as
CMP but when i try to create one, the database throws error back :
ERROR: Attribute 'valide' is of type 'bool' but expression is of type
'int4'
valide is a field in the bean : type boolean
valide is also a column in the table with BOOLEAN type
in standardjaws.xml data mapping of postgresSQL, i found this :
<mapping>
<java-type>java.lang.Boolean</java-type>
<jdbc-type>TINYINT</jdbc-type>
<sql-type>INT2</sql-type>
</mapping>
that is jBoss maps java primitive type boolean into pgsql type int2, so
value 'true' is inserted as 0 and value 'false'- i don't know. But it fails!
Since pgsql has a 'BOOLEAN' type, why map java.lang.Boolean to INT2 instead
of directly BOOLEAN? My guess is that, when jaws prepare the
PreparedStatement for inserting a boolean value, it uses setInt () (because
of type mapping to TINYINT) instead of setBoolean (). And then comes the
exception ....
Has anyone faced this problem ?
Reguards.
--hermann
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user