Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)

From: stagirus <mamasa(at)stagirus(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date: 2010-09-28 19:14:58
Message-ID: 1285701298407-2865634.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc


Thank you for the information provided above. It appears that we are all not
on the same page regarding the issue we are discussing. My apologies for my
share of communication gaps. Let me try again.

1. Create the table (DDL): CREATE TABLE st_employee (e_name varchar(30),
active SMALLINT);
2. Define a POJO: class Employee{ name String; active boolean};
3. Hibernate mapping:
<class name="Employee" table="st_employee">
<property name="name" type="string">
<column name="e_name" />
</property>
<property name="active" type="boolean">
<column name="active" />
</property>
4. Use Hibernate templates (DAO) to store and read the DB.

Observation: this works for Oracle and other DBs. Postgresql (9.0 and latest
JDBC drivers) complain about boolean cannot be cast to SMALLINT. I would
expect Postgresql work like other RDBMS like Oracle.

Thanks.

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-09-28 20:36:21 Re: BUG #5681: Using set returning function as subrequest can result losing rows in result set
Previous Message Tom Lane 2010-09-28 18:24:15 Re: LEFT OUTER JOIN sub-SELECT produces a column != NULL when all NULLs are expected

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2010-09-28 22:56:12 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Previous Message Craig Ringer 2010-09-28 06:11:53 Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)