Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql) - Mailing list pgsql-jdbc

From stagirus
Subject Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date
Msg-id 1285701298407-2865634.post@n5.nabble.com
Whole thread Raw
In response to Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List 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.

pgsql-jdbc by date:

Previous
From: knircky
Date:
Subject: Re: setQueryTimout()
Next
From: "Kevin Grittner"
Date:
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)