Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)

From: stagirus <mamasa(at)stagirus(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date: 2010-09-28 23:44:51
Message-ID: 1285717491749-2918544.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Oliver Jowett 2010-09-29 00:48:11 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Previous Message stagirus 2010-09-28 23:31:52 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2010-09-29 00:48:11 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Previous Message stagirus 2010-09-28 23:31:52 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)