pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: stagirus <mamasa@stagirus.com>
To: pgsql-bugs@postgresql.org
Subject: Mapping Hibernate boolean to smallint(Postgresql)
Date: Fri, 24 Sep 2010 14:33:57 -0700 (PDT)
Message-ID: <1285364037415-2853280.post@n5.nabble.com> (raw)


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-tp2853280p2...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.



view thread (53+ messages)  latest in thread

Message-ID: <1285364037415-2853280.post@n5.nabble.com>
Permalink:  ../1285364037415-2853280.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1285364037415-2853280.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: mamasa@stagirus.com
  Subject: Re: Mapping Hibernate boolean to smallint(Postgresql)
  In-Reply-To: <1285364037415-2853280.post@n5.nabble.com>
  References: <1285364037415-2853280.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox