Skip site navigation (1) Skip section navigation (2)

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

From: Jeff Hubbach <Jeff(dot)Hubbach(at)cha(dot)com>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date: 2010-10-05 16:03:34
Message-ID: 0FEDB42A-1C93-411C-853B-6CC27A4FBE44@cha.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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 works in 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 each database, any existing data you have in the database, and the Hibernate mapping files. Your java code remains untouched.

-- Jeff Hubbach

In response to

Responses

pgsql-bugs by date

Next:From: Alan T DeKokDate: 2010-10-05 17:11:21
Subject: Re: BUG #5687: RADIUS Authentication issues
Previous:From: Xiaohui XueDate: 2010-10-05 15:56:17
Subject: BUG #5694: Postgres ODBC SQLTables is not working correctly

pgsql-jdbc by date

Next:From: TimDate: 2010-10-05 22:06:17
Subject: JDBC type mappings
Previous:From: Oliver JowettDate: 2010-10-05 11:05:27
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group