Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id F2F0C63529E for ; Tue, 12 May 2009 11:02:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 82531-03 for ; Tue, 12 May 2009 11:02:37 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by mail.postgresql.org (Postfix) with ESMTP id 04C1C633EC3 for ; Tue, 12 May 2009 11:01:52 -0300 (ADT) Received: by ewy11 with SMTP id 11so4551352ewy.19 for ; Tue, 12 May 2009 07:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=sterGF1Bi0lMlbprG3BuTL8akdRpahMgcg2wXRav3og=; b=DjIe0+aCnZ7LbrwCAiiT/hW5ZbwtmfYlIFCO+eEuUUitHYe8yJP7eEtyoSro4Mbgh0 7/rj3gyyNQfqCR7KHvixk11VZ2G7lZe9Fshh2dX7XyQLqYmjL4QX3EVuZK/t8k+nUOtu 9+NPL6J45N8MUEy3yivYf6kKnNMyIRdgJ+yvE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=XSNBYB347bpYf+Xhryi/9U7Y7rlL8vmy115Vs8QraL2gtsDAGCNpybsuP0WjX5iU0K pDlQAY+anUA869DPavO5AXY56wp9H83hzIYKgGEhdy4xULT0EWDkDmgIIFcKjK9m0tpt R/dwDjsWGXURch/RLZvQfumgopoqsoDlcy/2Y= MIME-Version: 1.0 Received: by 10.216.13.74 with SMTP id a52mr3898495wea.145.1242136911151; Tue, 12 May 2009 07:01:51 -0700 (PDT) Date: Tue, 12 May 2009 16:01:51 +0200 Message-ID: <321ed0a30905120701w740c3b5fp9e2623f9cf0b3be@mail.gmail.com> Subject: Enums - from java to jpa From: The Jasper To: pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/61 X-Sequence-Number: 19611 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. --=20 Il se peut faire qu'il y ait des vraies d=E9monstrations; mais cela n'est pas certain. Ainsi, cela ne montre autre chose, sinon qu'il n'est pas certain que tout soit incertain, =E0 la gloire du pyrrhonisme. -B. Pascal