Re: smallint vs. boolean (was invalid string enlargement - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: smallint vs. boolean (was invalid string enlargement
Date
Msg-id 425C4733.7060107@opencloud.com
Whole thread Raw
In response to Re: smallint vs. boolean (was invalid string enlargement  (Glenn Holmer <gholmer@weycogroup.com>)
Responses Re: smallint vs. boolean (was invalid string enlargement
List 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

pgsql-jdbc by date:

Previous
From: Vernon
Date:
Subject: Data type for array of byte
Next
From: "Nico"
Date:
Subject: waiting during transaction