Skip site navigation (1) Skip section navigation (2)

Java persistence with enum types

From: Susannah Relf <cyclingrelf(at)googlemail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Java persistence with enum types
Date: 2009-05-23 14:02:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hi, I have an enum type in my postgres 8.3 database:

CREATE TYPE typeOfNames AS ENUM ('Latin', 'Common', 'Local');

I am trying to access the database through the Java Persistence API using
    @Column(name = "typeofname")
    private String typeofname;

This works for reading from the database, but writing to it, I get the error
Caused by: org.postgresql.util.PSQLException: ERROR: column "typeofname" is
of type typeofnames but expression is of type character varying

Anyone got any suggestions?



pgsql-jdbc by date

Next:From: Craig RingerDate: 2009-05-24 06:29:10
Subject: Re: Java persistence with enum types
Previous:From: Kris JurkaDate: 2009-05-18 22:10:41
Subject: Re: Does 8.3/8.4 support lazy fetched + updateable +scrollable ResultSets?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group