openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Java enum column incompatibility warning
Date Thu, 22 May 2014 21:01:19 GMT
Hi Jason,
I'm not aware of a change that went into 2.3.0 that would affect this type
of processing.  I just searched the JIRAs as well and didn't find
anything...  Can you post the exact warning message you are receiving?
Along with your Entity definition of the Enumerated type?  And, extract the
schema definition from your database?  I know we've had some issues with
sequence generators and Postgres, but I'm not aware of any issues with the
processing of enums.

Thanks, Kevin


On Thu, May 22, 2014 at 3:30 PM, Jason Reilly <jdr0887@renci.org> wrote:

> 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 <jdr0887@renci.org> 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
>>>>
>>>>
>>>>
>>>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message