Enums - from java to jpa

From: The Jasper <thejasper(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Enums - from java to jpa
Date: 2009-05-12 14:01:51
Message-ID: 321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

L.S.,

We are updating out application to make use of JPA. We have also
introduced postgres enums into our database. Naturally we also have
java enums which mirror the postgres enums. Now...how do I get JPA to
understand that it has different types at either end which are
actually the same. I mostly get ClassCastExceptions where PGObject is
being cast to String. I can't get rid of an enum definition at either
end, I'm stuck with that. So I need to make JPA understand how to map
from one to the other. We use Hibernate as our JPA implementation.

--
Il se peut faire qu'il y ait des vraies démonstrations; mais cela
n'est pas certain. Ainsi, cela ne montre autre chose, sinon qu'il
n'est pas certain que tout soit incertain, à la gloire du pyrrhonisme.
-B. Pascal

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2009-05-12 14:40:40 Re: Unable to access table named "user"
Previous Message Adrian Klaver 2009-05-12 13:59:16 Re: Unable to access table named "user"