pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Joseph Krogh <andreak@officenet.no>
To: pgsql-jdbc@postgresql.org
Subject: Re: [HACKERS] JPA + enum == Exception
Date: Fri, 5 Jul 2013 11:55:57 +0200 (CEST)
Message-ID: <OrigoEmail.92d.df33c04ef5eb80b3.13fae424147@prod2> (raw)
In-Reply-To: <CAPPfruwg8mn-YjZW7xfysaLwXkhXQ2k76P3xGGHsH9qweLE9_A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

<div>På fredag 05. juli 2013 kl. 11:47:22, skrev Tom Dunstan &lt;<a href="mailto:pgsql@tomd.cc" target="_blank">pgsql@tomd.cc</a>&gt;:</div>

<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hi Andreas
<div class="gmail_extra"> 
<div class="gmail_quote">On 5 July 2013 18:51, Andreas Joseph Krogh <span dir="ltr">&lt;<a href="mailto:andreak@officenet.no" target="_blank">andreak@officenet.no</a>&gt;</span> wrote:

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>I've been using Hibernate for years with mapping Enums to varchar-columns which works fine. Remember to map them with</div>

<div> </div>
</blockquote>

<div> </div>

<div style="">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. <a href="http://www.postgresql.org/docs/9.2/static/datatype-enum.html"; target="_blank">http://www.postgresql.org/docs/9.2/static/datatype-enum.html</a;. The built-in enum types are designed for that purpose, and perform better and more safely than using varchars.</div>

<div style=""> </div>

<div style="">Mapping java enums to a typesafe and efficient version in the 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 bit disappointed that it doesn't work out of the box. So I want to fix up whatever parts of the stack are in the way of making that work.</div>
</div>
</div>
</div>
</blockquote>

<div> </div>

<div>I'm sorry, I missread your post.</div>

<div> </div>

<div class="origo-email-signature">--<br>
Andreas Joseph Krogh &lt;andreak@officenet.no&gt;      mob: +47 909 56 963<br>
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no<br;
Public key: http://home.officenet.no/~andreak/public_key.asc</div;

<div> </div>


view thread (21+ messages)  latest in thread

Message-ID: <OrigoEmail.92d.df33c04ef5eb80b3.13fae424147@prod2>
Permalink:  ../OrigoEmail.92d.df33c04ef5eb80b3.13fae424147@prod2/
Also on:    postgresql.org/message-id/OrigoEmail.92d.df33c04ef5eb80b3.13fae424147@prod2

 · 

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: andreak@officenet.no
  Subject: Re: [HACKERS] JPA + enum == Exception
  In-Reply-To: <OrigoEmail.92d.df33c04ef5eb80b3.13fae424147@prod2>
  References: <CAPPfruwg8mn-YjZW7xfysaLwXkhXQ2k76P3xGGHsH9qweLE9_A@mail.gmail.com> <OrigoEmail.92d.df33c04ef5eb80b3.13fae424147@prod2>

* 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