Re: Mapping Hibernate boolean to smallint(Postgresql) - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: Mapping Hibernate boolean to smallint(Postgresql)
Date
Msg-id AANLkTi=QK==bmA9CMFztrXMT=1YEYB06YezzckKcS+7k@mail.gmail.com
Whole thread Raw
In response to Re: Mapping Hibernate boolean to smallint(Postgresql)  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: Mapping Hibernate boolean to smallint(Postgresql)  (stagirus <mamasa@stagirus.com>)
List pgsql-bugs
>> Now comes the "religious" discussion. The above design works well for
>> Oracle, DB2 and MySQL, etc. But PostgresQL seems to choke. It complains
>> about the data type mismatch. By reading various discussions on your
>> forum,
>> there seems to some issues with the data type mapping at the JDBC driver.
>> JDBC driver does not convert boolean value (false/true) to integers (0/1).
>

There isn't really enough information here to diagnose the problem,
but here's another guess - if it's just a problem with HQL generated
queries, perhaps you could try adding the following to your Hibernate
configuration:

<property name="hibernate.query.substitutions">true 1, false 0</property>

Regards,
Dean

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Mapping Hibernate boolean to smallint(Postgresql)
Next
From: r d
Date:
Subject: Postgres 9 Installation problems