Re: smallint vs. boolean (was invalid string enlargement

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Glenn Holmer <gholmer(at)weycogroup(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: smallint vs. boolean (was invalid string enlargement
Date: 2005-04-12 22:09:55
Message-ID: 425C4733.7060107@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nico 2005-04-13 01:36:48 waiting during transaction
Previous Message Vernon 2005-04-12 17:06:43 Data type for array of byte