Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uv2kF-0005RQ-DT for pgsql-jdbc@arkaria.postgresql.org; Fri, 05 Jul 2013 09:56:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uv2kE-0001st-T7 for pgsql-jdbc@arkaria.postgresql.org; Fri, 05 Jul 2013 09:56:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uv2kD-0001sm-Sg for pgsql-jdbc@postgresql.org; Fri, 05 Jul 2013 09:56:02 +0000 Received: from prod2.officenet.no ([195.159.87.246]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uv2kA-0001K6-UU for pgsql-jdbc@postgresql.org; Fri, 05 Jul 2013 09:56:01 +0000 Received: from localhost ([127.0.0.1] helo=prod2) by prod2.officenet.no with esmtp (Exim 4.76) (envelope-from ) id 1Uv2k9-0005mf-BT for pgsql-jdbc@postgresql.org; Fri, 05 Jul 2013 11:55:57 +0200 Date: Fri, 5 Jul 2013 11:55:57 +0200 (CEST) From: Andreas Joseph Krogh To: pgsql-jdbc@postgresql.org Message-ID: In-Reply-To: Subject: Re: [HACKERS] JPA + enum == Exception MIME-Version: 1.0 X-Mailer: OfficeNet Mail 1.9.0-SNAPSHOT X-Pg-Spam-Score: 1.7 (+) Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org
P=C3=A5 fredag 05. juli 2013 kl. 11:47:22, skrev Tom Dunstan <pgsql@tomd.cc>:
Hi Andreas
=C2=A0
On 5 July 2013 18:51, Andreas Joseph Krogh <= andreak@officenet.no> wrote:
I've been using Hibernate for years with mapping Enums to varchar-colu= mns which works fine. Remember to map them with
=C2=A0
=C2=A0
I'm not trying to map them to varchar columns - I'm trying = to map them to columns with postgresql enum types as created by CREATE TYPE= , see e.g. http://www.postgresql.org/docs/9.2/static/dataty= pe-enum.html. The built-in enum types are designed for that purpose, an= d perform better and more safely than using varchars.
=C2=A0
Mapping java enums to a typesafe and efficient version in t= he db was the main reason I did the work to add native enums to postgresql = in the first place - I haven't had a chance to use it recently, and I'm a b= it disappointed that it doesn't work out of the box. So I want to fix up wh= atever parts of the stack are in the way of making that work.
=C2=A0
I'm sorry, I missread your post.
=C2=A0
--
Andreas Joseph Krogh <andreak@officenet.no>=C2=A0 =C2=A0 =C2=A0 mob: = +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
=C2=A0
=