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

Re: Mapping Hibernate boolean to smallint(Postgresql)

From: stagirus <mamasa(at)stagirus(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Mapping Hibernate boolean to smallint(Postgresql)
Date: 2010-09-25 19:31:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
As a fundamental protocol, I prefer to keep any "attitudes" and
"finger-pointing" off the table. Let us just focus on the real

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" />
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.

Please refer to the following data type mapping between Java types and SQL
Is there any similar mapping reference for PostgresQL data types? (Seems
this question was already raised and successfully ignored!)

day & age compatibility with Hibernate got to be a key goal for any RDBMS.


View this message in context:
Sent from the PostgreSQL - bugs mailing list archive at

In response to

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2010-09-25 19:38:38
Subject: Re: libpq: system-wide root.crt
Previous:From: Kirill SimonovDate: 2010-09-25 18:33:16
Subject: LEFT OUTER JOIN sub-SELECT produces a column != NULL when all NULLs are expected

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