1

Is there a way to tell JPA / EclipseLink to ignore enums it encounters in the database that aren't defined in the java enum?

Instead of getting this exception: No conversion value provided for the value...

There doesn't seem to be a way to add an enum to the DB, promote a new version of the code, while keeping another old instance of the code running on the same database.

asked May 29, 2013 at 22:32

1 Answer 1

2

EclipseLink uses an EnumTypeConverter to convert Enums, which is a subclass of ObjectTypeConverter.

If you use an @ObjectTypeConverter directly, you can set a defaultObjectValue to default values from the database that are not mapped. You could also use your own Converter, or set the defaultValue in the EnumTypeConverter through a DescriptorCustomizer.

answered May 30, 2013 at 13:30
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.