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: Re: Mapping Hibernate boolean to smallint(Postgresql)
Date: Sat, 25 Sep 2010 12:31:55 -0700 (PDT)
Message-ID: <1285443115092-2853928.post@n5.nabble.com> (raw )
In-Reply-To: <AANLkTi=QK==bmA9CMFztrXMT=1YEYB06YezzckKcS+7k@mail.gmail.com >
References: <1285364037415-2853280.post@n5.nabble.com >
<4C9D661B.7010301@postnewspapers.com.au >
<AANLkTi=QK==bmA9CMFztrXMT=1YEYB06YezzckKcS+7k@mail.gmail.com >
As a fundamental protocol, I prefer to keep any "attitudes" and
"finger-pointing" off the table. Let us just focus on the real
problem-solving.
Though I am very versatile in speaking languages like C, C++ and Java, I
assumed we all can speak and understand "English." You can also clearly see
the issue on table is complicated. It spans Java, Hibernate, JDBC Drivers,
RDBMS Engines and and finally people.
Yes, the error is like - column "y" is of type integer but expression is of
type boolean. I just expressed it in natural language "type mismatch."
Below is the sample HBM file block.
<property name="deleted" type="boolean">
<column name="DELETED" />
</property>
In the DB, DELETED column is SMALLINT but in the Java(POJOs), it is boolean.
I like Dean's suggestion about "hibernate.query.substitutions." But does it
really solve the issue? The current code (HBM mapping) is fully functional
with Oracle (SMALLINT).
That leaves us only two variables in the equation:
1. PostgresQL JDBC Driver
2. PostgresQL DB Engine.
During my research on your JDBC discussion forum, I learned that JDBC team
is mapping Java boolean to BIT or chars. Please refer this discussion.
http://postgresql.1045698.n5.nabble.com/Wrong-SqlType-for-boolean-columns-td2256874.html#a2256874
Please refer to the following data type mapping between Java types and SQL
types.
Oracle:
http://download.oracle.com/javase/1.3/docs/guide/jdbc/getstart/mapping.anc1.gif
DB2:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/rjvjdata....
Is there any similar mapping reference for PostgresQL data types? (Seems
this question was already raised and successfully ignored!)
http://postgresql.1045698.n5.nabble.com/PostgreSQL-types-and-Java-types-td2174117.html
ARE THERE ANY ALTERNATIVE (3rd-party) JDBC DRIVERs FOR POSTGRESQL? In this
day & age compatibility with Hibernate got to be a key goal for any RDBMS.
thanks.
--
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: <1285443115092-2853928.post@n5.nabble.com>
Permalink: ../1285443115092-2853928.post@n5.nabble.com/
Also on: postgresql.org/message-id/1285443115092-2853928.post@n5.nabble.com
copy link · copy postgr.es
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: <1285443115092-2853928.post@n5.nabble.com>
References: <1285364037415-2853280.post@n5.nabble.com> <4C9D661B.7010301@postnewspapers.com.au> <AANLkTi=QK==bmA9CMFztrXMT=1YEYB06YezzckKcS+7k@mail.gmail.com> <1285443115092-2853928.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