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

From stagirus
Subject Mapping Hibernate boolean to smallint(Postgresql)
Date
Msg-id 1285364037415-2853280.post@n5.nabble.com
Whole thread Raw
Responses Re: Mapping Hibernate boolean to smallint(Postgresql)  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Mapping Hibernate boolean to smallint(Postgresql)  (Craig Ringer <craig@postnewspapers.com.au>)
List 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.

pgsql-bugs by date:

Previous
From: Christopher A Hotchkiss
Date:
Subject: Re: BUG #5676: When creating a trigger an dummy argument is inserted.
Next
From: "Kevin Grittner"
Date:
Subject: Re: Mapping Hibernate boolean to smallint(Postgresql)