Skip site navigation (1) Skip section navigation (2)

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-29 12:06:50
Message-ID: 1285762010765-3005405.post@n5.nabble.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-jdbc
Oliver:
>>* use a real boolean column in their schema (I mean, the data you're
representing IS a boolean value in this case, right?); 
--- No, we already tried this path. Unfortunately boolean is not portable
column type among DB vendors. So, we ruled out this option.
 
or
* use setObject(column, value, Types.SMALLINT) instead of the implied
setBoolean() call when setting the column (this may be tricky to do
since you have a layer between you and the driver, but that's not really
the driver's fault..); or
---I am not sure if our application developers have this option. Hibernate
handles this for us. I am not pointing fingers. I am curious how other DBs
or JDBC drivers handle it so transparently.

* add a suitable implicit cast on the backend side from boolean ->
smallint (not sure if this works, haven't looked at the details)
-- we will look into it.

Do any of these work for you? The first suggestion seems to be the
simplest to me, since you really are storing a boolean, not a smallint,
and you have control over the DDL.
--Not yet, please.

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

In response to

Responses

pgsql-bugs by date

Next:From: Craig RingerDate: 2010-09-29 12:13:20
Subject: Re: BUG #5682: Postgres Service crashes with exception 0xC0000135
Previous:From: donovanscDate: 2010-09-29 10:16:49
Subject: BUG #5683: Service path incorrectly configured

pgsql-jdbc by date

Next:From: stagirusDate: 2010-09-29 12:16:45
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Previous:From: Kevin GrittnerDate: 2010-09-29 11:54:54
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group