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

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-bugs by date

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

pgsql-jdbc by date

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

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