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 <jdr0...@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