Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-jdbc(at)postgresql(dot)org, stagirus <mamasa(at)stagirus(dot)com>
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date: 2010-09-27 23:01:53
Message-ID: AANLkTi=OgduBWb4XLo3bqUXJULNEvUKCAh54xhiEgOjU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

On Mon, Sep 27, 2010 at 1:43 PM, Oliver Jowett <oliver(at)opencloud(dot)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?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2010-09-28 00:52:17 Re: BUG #5680: Failure to start: too many private dirs demanded
Previous Message Daniel Grace 2010-09-27 21:09:14 Planner producing 100% duplicate subplans when unneeded

Browse pgsql-jdbc by date

  From Date Subject
Next Message knircky 2010-09-28 00:29:13 setQueryTimout()
Previous Message Oliver Jowett 2010-09-27 20:43:15 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)