Hibernate + setObject() + boolean problem with a patch

Поиск
Список
Период
Сортировка
От Kalle Kivimaa
Тема Hibernate + setObject() + boolean problem with a patch
Дата
Msg-id 87psyy884o.fsf@kaylee.killeri.net
обсуждение исходный текст
Ответы Re: Hibernate + setObject() + boolean problem with a patch  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
We are using Hibernate on top of PostgreSQL and with a recent switch
to PostgreSQL 8.0 we ran into a problem that trying to insert rows
with null boolean fields to the DB failed miserably. I traced the
problem to the fact that Hibernate wants to do this throuhg
setObject() and this does not handle null booleans. The attached patch
handles the booleans the same way as bits are handled which I think is
the correct way (at least it solved our problem).

--
* Sufficiently advanced magic is indistinguishable from technology (T.P)  *
*           PGP public key available @ http://www.iki.fi/killer           *
Index: org/postgresql/jdbc2/AbstractJdbc2Statement.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v
retrieving revision 1.72
diff -u -r1.72 AbstractJdbc2Statement.java
--- org/postgresql/jdbc2/AbstractJdbc2Statement.java    16 Feb 2005 18:28:45 -0000    1.72
+++ org/postgresql/jdbc2/AbstractJdbc2Statement.java    18 Feb 2005 10:38:44 -0000
@@ -982,6 +982,7 @@
             oid = Oid.TIMESTAMPTZ;
             break;
         case Types.BIT:
+        case Types.BOOLEAN:
             oid = Oid.BOOL;
             break;
         case Types.BINARY:

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Matt Magoffin"
Дата:
Сообщение: Statement setNull for Types.CLOB
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Statement setNull for Types.CLOB