Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18328118C9 for ; Thu, 22 May 2014 20:30:52 +0000 (UTC) Received: (qmail 10248 invoked by uid 500); 22 May 2014 20:30:51 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 10200 invoked by uid 500); 22 May 2014 20:30:51 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 10192 invoked by uid 99); 22 May 2014 20:30:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 20:30:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of prvs=02194111DC=jdr0887@renci.org designates 152.54.5.131 as permitted sender) Received: from [152.54.5.131] (HELO gateway.renci.org) (152.54.5.131) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 20:30:47 +0000 Received: from MAIL-CH2.ad.renci.org (172.25.10.51) by gateway.ad.renci.org (172.25.10.131) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 22 May 2014 16:30:25 -0400 Received: from [152.54.8.203] (172.25.10.131) by mail.renci.org (172.25.10.58) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 22 May 2014 16:30:25 -0400 Message-ID: <537E5E60.2060900@renci.org> Date: Thu, 22 May 2014 16:30:24 -0400 From: Jason Reilly User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Subject: Re: Java enum column incompatibility warning References: <537E4B6C.5020801@renci.org> <537E4BA9.8020602@renci.org> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org With OpenJPA 2.2.2, the generated column length for an @Enumerated(EnumType.STRING) is varchar(255) in Postgresql. With an upgrade to OpenJPA 2.3.0, I think that the expected column length is the length of the Enum's longest value....usually shorter than 255 characters. I suspect this could problematic (at least annoying) if the database schema was first created with OpenJPA 2.3.0 and the database column length had to be adjusted every time I add a new Enum that is longer than the previously longest Enum value. On 05/22/2014 04:09 PM, Kevin Sutter wrote: > Well, if you don't have access or the means to update this varchar length, > then you probably have to ignore it... :-) This is a warning to indicate > a mismatch. I suppose you can ignore it, but then you have a chance of > truncated values. Are the enum values pre-defined like the column size? > Or, can you maybe abbreviate the enum values to make them fit the column > size? It's really up to you whether these warnings are safe to ignore or > not. > > Kevin > > > On Thu, May 22, 2014 at 2:10 PM, Jason Reilly wrote: > >> Sorry....I am using OpenJPA 2.3.0 >> >> >> On 05/22/2014 03:09 PM, Jason Reilly wrote: >> >>> Hi all, >>> >>> I am getting a warning that the column that an Enum is mapped to (as a >>> string) is incompatible with the column in the schema definition. Looks >>> like the expected column size is the length of the longest Enum value. As >>> it is a warning and I don't easily have access to change the varchar >>> length, can this be safely ignored? >>> >>> Thanks, >>> Jason >>> >>> >>>