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

From Jeff Hubbach
Subject Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date
Msg-id 0FEDB42A-1C93-411C-853B-6CC27A4FBE44@cha.com
Whole thread Raw
In response to Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (stagirus <mamasa@stagirus.com>)
Responses Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (stagirus <mamasa@stagirus.com>)
List pgsql-jdbc
I found this post in Hibernate's forums:

https://forum.hibernate.org/viewtopic.php?f=1&t=944165&p=2247802&hilit=postgres+boolean+smallint#p2247802

In summary, Hibernate will handle converting a char(1) in the database to/from boolean in java, and from that post, it
worksin DB2 and PostgreSQL. 

So here's another option. Change your smallint in the database to a char(1). The only thing it affects is the DDL for
eachdatabase, any existing data you have in the database, and the Hibernate mapping files. Your java code remains
untouched.

-- Jeff Hubbach

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Next
From: Boris Partensky
Date:
Subject: Re: Upgrading JDBC driver from 7.3 to 8.4 affected execution plans