Re: [HACKERS] JPA + enum == Exception - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: [HACKERS] JPA + enum == Exception
Date
Msg-id CADK3HHJq5kGJ_d6BK4wp2zCGLCx-gd+Of1cnrm0y=kTqgoQZ8g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] JPA + enum == Exception  (Tom Dunstan <pgsql@tomd.cc>)
List pgsql-jdbc
Tom,

Thanks!

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Sun, Jul 7, 2013 at 12:09 AM, Tom Dunstan <pgsql@tomd.cc> wrote:
On 5 July 2013 19:27, Dave Cramer <pg@fastcrypt.com> wrote:
I would think setObject should respect stringtype=unspecified. So I would be willing to accept this as a solution

OK, here's a pull request with a unit test to cover expected behaviour with different combinations of setObject and setString, for inserts and queries.


Interestingly, when I first tried this I tried using point as the type to test rather than an enum (so that I didn't have to create the enum type in the test), but it would fail when trying to select a row out in a query like "select * from thetable where p = ?" saying "operator does not exist: point = unknown". I presume that this due to multiple = operators for the point type at the db level, so the backend can't decide which type to create. I guess there's not much that we can do about that - if things are ambiguous then you need to be more specific, and of course we have a PGpoint java object anyway.

Cheers

Tom

pgsql-jdbc by date:

Previous
From: dmp
Date:
Subject: Website Updates?
Next
From: Dave Cramer
Date:
Subject: Re: Website Updates?