Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 56B8B1337B64 for ; Wed, 29 Sep 2010 09:07:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 51834-01-10 for ; Wed, 29 Sep 2010 12:07:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 23CF11337BFD for ; Wed, 29 Sep 2010 09:06:51 -0300 (ADT) Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1P0vQw-0001lQ-Os for pgsql-jdbc@postgresql.org; Wed, 29 Sep 2010 05:06:50 -0700 Date: Wed, 29 Sep 2010 05:06:50 -0700 (PDT) From: stagirus To: pgsql-jdbc@postgresql.org Message-ID: <1285762010765-3005405.post@n5.nabble.com> In-Reply-To: <4CA28CCB.5020400@opencloud.com> References: <1285601721239-2855475.post@n5.nabble.com> <4CA0805B0200002500035F43@gw.wicourts.gov> <4CA101E3.5080005@opencloud.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> Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.778 tagged_above=-10 required=5 tests=BAYES_00=-1.9, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201009/79 X-Sequence-Number: 20949 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.