Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 161451337B2F for ; Tue, 28 Sep 2010 20:45:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 31431-09 for ; Tue, 28 Sep 2010 23:44:52 +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 D67441336FA7 for ; Tue, 28 Sep 2010 20:44:51 -0300 (ADT) Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1P0jqt-000079-ON for pgsql-jdbc@postgresql.org; Tue, 28 Sep 2010 16:44:51 -0700 Date: Tue, 28 Sep 2010 16:44:51 -0700 (PDT) From: stagirus To: pgsql-jdbc@postgresql.org Message-ID: <1285717491749-2918544.post@n5.nabble.com> In-Reply-To: <4CA18729.90401@postnewspapers.com.au> References: <4CA064B50200002500035F29@gw.wicourts.gov> <1285601721239-2855475.post@n5.nabble.com> <4CA0805B0200002500035F43@gw.wicourts.gov> <4CA101E3.5080005@opencloud.com> <4CA1743F.2060301@postnewspapers.com.au> <4CA18729.90401@postnewspapers.com.au> 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/73 X-Sequence-Number: 20943 >>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.