X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 08F6453379 for ; Tue, 12 Apr 2005 19:10:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68729-03 for ; Tue, 12 Apr 2005 22:09:57 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 41D7B533B2 for ; Tue, 12 Apr 2005 19:09:55 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DLTa0-0000zs-Il; Wed, 13 Apr 2005 10:09:56 +1200 Message-ID: <425C4733.7060107@opencloud.com> Date: Wed, 13 Apr 2005 10:09:55 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Glenn Holmer Cc: pgsql-jdbc@postgresql.org Subject: Re: smallint vs. boolean (was invalid string enlargement References: <42389DFC.5090408@weycogroup.com> <4238A223.4030003@opencloud.com> <4239B075.7020305@weycogroup.com> <4239EA95.4020101@opencloud.com> <1113325530.26370.50.camel@shadow.weycogroup.com> In-Reply-To: <1113325530.26370.50.camel@shadow.weycogroup.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/74 X-Sequence-Number: 12681 Glenn Holmer wrote: > On Fri, 2005-03-18 at 09:37 +1300, Oliver Jowett wrote: >>This behaviour is unlikely to change, so you might want to look at >>tracking down the cause. As a last resort, you might be able to create >>implicit casts between smallint<->boolean. > > > Yes, the database has some fields defined as smallint and set to 0 for > false or either 1 for true; the Hibernate DTOs have these fields > declared as boolean. > > Is there any way around this without rewriting everything? Change the column type so it is a boolean, change the hibernate mapping so it calls setShort(), or create the implicit cast as I suggested. -O