Hermann,
I'm running PostgreSQL 7.1.2 with JBoss 2.2.2 with
sucess of CMP beans creating tables upon deployment
but I too have had difficulty with the Boolean
datatype. I've gotten it to insert and update 1 for
true and 0 for false but when the server (JBoss) is
restarted it writes all boolean fields acted upon back
to false. I haven't tried mapping the datatype in
JAWS to bool yet, as I'm working on other parts of the
project. I may try today. If I works I'll be sure to
let you know.
--- Hermann RANGAMANA <[EMAIL PROTECTED]>
wrote:
> 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
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user