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

Поиск
Список
Период
Сортировка
От stagirus
Тема Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Дата
Msg-id 1285701298407-2865634.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Список 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 по дате отправления:

Предыдущее
От: knircky
Дата:
Сообщение: Re: setQueryTimout()
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)