pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: stagirus <mamasa@stagirus.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date: Wed, 29 Sep 2010 05:06:50 -0700 (PDT)
Message-ID: <1285762010765-3005405.post@n5.nabble.com> (raw)
In-Reply-To: <4CA28CCB.5020400@opencloud.com>
References: <1285601721239-2855475.post@n5.nabble.com>
	<4CA0805B0200002500035F43@gw.wicourts.gov>
	<4CA101E3.5080005@opencloud.com>
	<AANLkTi=OgduBWb4XLo3bqUXJULNEvUKCAh54xhiEgOjU@mail.gmail.com>
	<4CA1743F.2060301@postnewspapers.com.au>
	<4CA18729.90401@postnewspapers.com.au>
	<1285701298407-2865634.post@n5.nabble.com>
	<4CA22C3C0200002500036065@gw.wicourts.gov>
	<1285716712781-2916249.post@n5.nabble.com>
	<4CA28CCB.5020400@opencloud.com>


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-tp2...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.



view thread (53+ messages)  latest in thread

Message-ID: <1285762010765-3005405.post@n5.nabble.com>
Permalink:  ../1285762010765-3005405.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1285762010765-3005405.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mamasa@stagirus.com
  Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
  In-Reply-To: <1285762010765-3005405.post@n5.nabble.com>
  References: <1285601721239-2855475.post@n5.nabble.com> <4CA0805B0200002500035F43@gw.wicourts.gov> <4CA101E3.5080005@opencloud.com> <AANLkTi=OgduBWb4XLo3bqUXJULNEvUKCAh54xhiEgOjU@mail.gmail.com> <4CA1743F.2060301@postnewspapers.com.au> <4CA18729.90401@postnewspapers.com.au> <1285701298407-2865634.post@n5.nabble.com> <4CA22C3C0200002500036065@gw.wicourts.gov> <1285716712781-2916249.post@n5.nabble.com> <4CA28CCB.5020400@opencloud.com> <1285762010765-3005405.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox