Mapping Hibernate boolean to smallint(Postgresql)

From: stagirus <mamasa(at)stagirus(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Mapping Hibernate boolean to smallint(Postgresql)
Date: 2010-09-24 21:33:57
Message-ID: 1285364037415-2853280.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Good afternoon. I am the Chief Architect, with 19 years of experience in the
software industry, for an enterprise software product. I am requesting your
help to better understand or resolve the following issue.

Our architecture is based on Spring and Hibernate. The product is required
to support multiple databases (RDBMS neutral). Our product extensively
utilizes "boolean" fields. In the database (DDL), we store these boolean
fields into SmallInt, ANSI SQL data type for maximum portability. Hibernate
maps these Java boolean types to DB SmallInt fields.

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). I
understand you have your own reasons for this but this is a real
architectural scenario anyone should expect at this age of RDBMS.

I am new to PostgresQL but I also heard great things about PostgresQL. Your
recent improvements towards High Availability (HA) especially Streaming
Replication seems to be an impression direction. But it amazes me why such
simple/flexible feature was not supported yet. I would greatly appreciate
your insights.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Mapping-Hibernate-boolean-to-smallint-Postgresql-tp2853280p2853280.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2010-09-24 21:46:53 Re: Mapping Hibernate boolean to smallint(Postgresql)
Previous Message Andrew Dunstan 2010-09-24 20:30:52 Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running