Re: Bug: Cannot pass null in Parameter in Query for ISNULL

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>, bht(at)actrix(dot)gen(dot)nz, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug: Cannot pass null in Parameter in Query for ISNULL
Date: 2011-12-01 13:39:45
Message-ID: 4ED783A1.4040609@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 12/01/2011 05:38 PM, Oliver Jowett wrote:
> On 1 December 2011 22:21, Mikko Tiihonen
> <mikko(dot)tiihonen(at)nitorcreations(dot)com> wrote:
>
>> So far it has been established that the JPA implementation you are
>> using uses an unportable hack that happens to work for some DB vendors
>> but not with postgresql.
>
> While we're at it - what is the JPA implementation in question?

I'd be interested too, as I've had no issues related to null handling
using EclipseLink or Hibernate (3 and 4) with PostgreSQL.

(on a side-note):

I *have* had annoying issues working with the `xml' datatype (and other
text-like types) where I'd like to work with them as String in Java.
This is really a JPA deficiency as much as a PgJDBC one, in that JPA
doesn't really offer a way to say "this is the Java type, but please use
this other SQLTYPE when passing it to the JDBC driver". The JPA
implementation would use setString(...) instead of setObject(...) with
the SQLXML type constant, and Pg would refuse to accept a `text' value
for an `xml' field.

I kind of wish there was an implicit cast from `text' to `xml' since
there's well-formedness checking done anyway, but in this case the real
problem is that JPA doesn't let you specify an explicit JPA type or
override how the value is passed to the JDBC driver. Some specific JPA
implementations offer extensions for this, though.

--
Craig Ringer

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maciek Sakrejda 2011-12-01 19:41:10 Re: Bug: Cannot pass null in Parameter in Query for ISNULL
Previous Message Joel Jacobson 2011-12-01 12:21:39 Re: Java LISTEN/NOTIFY client library work-around