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: Re: Java persistence with enum types
Date: Tue, 26 May 2009 17:17:35 +0200
Message-ID: <321ed0a30905260817s5f92344kc7ecb76af623f3b3@mail.gmail.com> (raw)
In-Reply-To: <23705886.post@talk.nabble.com>
References: <548aeab30905230702x1e7d0620nb3686c49bf889a68@mail.gmail.com>
	<4A18E936.1030803@postnewspapers.com.au>
	<23705886.post@talk.nabble.com>

On Mon, May 25, 2009 at 2:01 PM, Susannah <cyclingrelf@googlemail.com> wrote:
>
> Hi,
>
> Thanks for trying to help Craig, but I had tried the @enumerated annotation
> already with the same error message. The @enumerated annotation doesn't
> return an enum type to Postgres, but instead returns the ordinal value (by
> default) or a string value of the enum. This means I get either the error
> message:
>
> Caused by: org.postgresql.util.PSQLException: ERROR: column "typeofname" is
> of type typeofnames but expression is of type character varying
> (if I use enumtype STRING)
>
> Or
>
> Caused by: org.postgresql.util.PSQLException: ERROR: column "typeofname" is
> of type typeofnames but expression is of integer

I think you have the same problem I did a while back. A colleague of
mine figured it out. There is a partial answer here:
http://stackoverflow.com/questions/851758/java-enums-jpa-and-postgres-enums-how-do-i-make-them-work-...

Don't have time to dig up and clean up the actual code we use now but
I can if you'd like (and you're not in a hurry).

mvg,

Jasper
-- 
http://xkcd.com/583/



view thread (4+ messages)

Message-ID: <321ed0a30905260817s5f92344kc7ecb76af623f3b3@mail.gmail.com>
Permalink:  ../321ed0a30905260817s5f92344kc7ecb76af623f3b3@mail.gmail.com/
Also on:    postgresql.org/message-id/321ed0a30905260817s5f92344kc7ecb76af623f3b3@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: Java persistence with enum types
  In-Reply-To: <321ed0a30905260817s5f92344kc7ecb76af623f3b3@mail.gmail.com>
  References: <548aeab30905230702x1e7d0620nb3686c49bf889a68@mail.gmail.com> <4A18E936.1030803@postnewspapers.com.au> <23705886.post@talk.nabble.com> <321ed0a30905260817s5f92344kc7ecb76af623f3b3@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