pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: The Jasper <thejasper@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Enums - from java to jpa
Date: Tue, 12 May 2009 16:01:51 +0200
Message-ID: <321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com>
Permalink:  ../321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com/
Also on:    postgresql.org/message-id/321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: thejasper@gmail.com
  Subject: Re: Enums - from java to jpa
  In-Reply-To: <321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com>
  References: <321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox