Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DE3091337B76 for ; Tue, 28 Sep 2010 16:15:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 88251-06 for ; Tue, 28 Sep 2010 19:15:00 +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 D5CDB1337B55 for ; Tue, 28 Sep 2010 16:14:59 -0300 (ADT) Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1P0fdi-0003tW-DV for pgsql-jdbc@postgresql.org; Tue, 28 Sep 2010 12:14:58 -0700 Date: Tue, 28 Sep 2010 12:14:58 -0700 (PDT) From: stagirus To: pgsql-jdbc@postgresql.org Message-ID: <1285701298407-2865634.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/70 X-Sequence-Number: 20940 Thank you for the information provided above. It appears that we are all not on the same page regarding the issue we are discussing. My apologies for my share of communication gaps. Let me try again. 1. Create the table (DDL): CREATE TABLE st_employee (e_name varchar(30), active SMALLINT); 2. Define a POJO: class Employee{ name String; active boolean}; 3. Hibernate mapping: 4. Use Hibernate templates (DAO) to store and read the DB. Observation: this works for Oracle and other DBs. Postgresql (9.0 and latest JDBC drivers) complain about boolean cannot be cast to SMALLINT. I would expect Postgresql work like other RDBMS like Oracle. Thanks. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Re-BUGS-Mapping-Hibernate-boolean-to-smallint-Postgresql-tp2855367p2865634.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.