Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql) - Mailing list pgsql-jdbc

From stagirus
Subject Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date
Msg-id 1285717491749-2918544.post@n5.nabble.com
Whole thread Raw
In response to Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-jdbc
>>Are you using your own DDL to define your tables, so you're mapping
types as shorts in hibernate but using booleans in the database? Because
that's not how Hibernate expects it to be, it expects a short if you
tell it you're mapping a short.<<<

Craig: the scenario you have described is different from the one we are
facing.

1. Yes, we define and manage our own DDL, not generate from Hibernate. We
prefer to keep it that way.
2. We define the column in the database table as SMALLINT not boolean.
Please refer to my post below.
3. As described below, in the Hibernate we map Java boolean to DB SMALLINT.
Below I showed the mapping.
Obviously we assume java boolean values and DB integer values (columns) are
interchangeable. Poor "boolean" values have no real shape among DB vendors
and ANSI SQL.

I hope this makes sense.

Thanks.


--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Re-BUGS-Mapping-Hibernate-boolean-to-smallint-Postgresql-tp2855367p2918544.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

pgsql-jdbc by date:

Previous
From: stagirus
Date:
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Next
From: Oliver Jowett
Date:
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)