Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql) - Mailing list pgsql-jdbc

From Samuel Gendler
Subject Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date
Msg-id AANLkTi=OgduBWb4XLo3bqUXJULNEvUKCAh54xhiEgOjU@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-jdbc
On Mon, Sep 27, 2010 at 1:43 PM, Oliver Jowett <oliver@opencloud.com> wrote:
I would suggest that the OP either:

* use a real boolean column in their schema (I mean, the data you're
representing IS a boolean value in this case, right?); or
* use setObject(column, value, Types.SMALLINT) instead of the implied
setBoolean() call when setting the column (this may be tricky to do
since you have a layer between you and the driver, but that's not really
the driver's fault..); or
* add a suitable implicit cast on the backend side from boolean ->
smallint (not sure if this works, haven't looked at the details)


I would actually suggest running your problem past the hibernate community.  It seems unlikely that you're the first team to encounter this problem.  How do you have the property mapped in the hibernate mapping?  Is it possible that explicitly setting the hibernate type of the property in the mapping will solve your problem?


pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Next
From: knircky
Date:
Subject: setQueryTimout()