Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id F0CC363252F for ; Sun, 24 May 2009 03:29:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 42147-06 for ; Sun, 24 May 2009 03:29:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.61.230.242]) by mail.postgresql.org (Postfix) with ESMTP id 4FD33632270 for ; Sun, 24 May 2009 03:29:19 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id F24F35C1E5; Sun, 24 May 2009 14:29:15 +0800 (WST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id D896C1E0437; Sun, 24 May 2009 14:29:15 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gVZvYbLqHZs9; Sun, 24 May 2009 14:29:11 +0800 (WST) Received: from [192.168.44.57] (203-59-94-220.perm.iinet.net.au [203.59.94.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTP id 4D7B61E0436; Sun, 24 May 2009 14:29:11 +0800 (WST) Message-ID: <4A18E936.1030803@postnewspapers.com.au> Date: Sun, 24 May 2009 14:29:10 +0800 From: Craig Ringer User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: Susannah Relf CC: pgsql-jdbc@postgresql.org Subject: Re: Java persistence with enum types References: <548aeab30905230702x1e7d0620nb3686c49bf889a68@mail.gmail.com> In-Reply-To: <548aeab30905230702x1e7d0620nb3686c49bf889a68@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL=0.005 X-Spam-Level: X-Archive-Number: 200905/96 X-Sequence-Number: 19646 Susannah Relf wrote: > 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 > Netbeans: > @Lob > @Column(name = "typeofname") > private String typeofname; One minute with Google: @Enumerated http://java.sun.com/javaee/5/docs/api/javax/persistence/Enumerated.html http://forums.java.net/jive/thread.jspa?messageID=240608 http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#Enumerated ... etc ... -- Craig Ringer