I have used this all the time, but now it's no longer working. Really strange. Code snippet:
@Column(name = "STAT", length = 16)
@Enumerated(EnumType.STRING)
private State state = State.LIVE;
...
public enum State {
LIVE,
DELETED;
}
In the db, there are only values stored with LIVE or DELETED. No nulls.
But i'm getting: Exception [EclipseLink-116] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.DescriptorException Exception Description: No conversion value provided for the value [0] in field [WERK.STAT]. Mapping: org.eclipse.persistence.mappings.DirectToFieldMapping[state-->WERK.STAT]
It seems to me, that the ordinal ('...provided for the value [0]...') comes - somehow - into place, but i don't know why and how to get rid of it.
I'm using glassfish 3.1.2 which uses eclipselink 2.3.2. I upgraded to eclipselink 2.4.2 with the same result. It's weird, because it's running on my development machine without any problems. I'm using mysql 5.6.14.
Thx
Got it. The exception text is finally wrong. I found that [0] value, but in a completely different table (which has no reference to WERK at all) and has been imported using an sql script containing these [0] values (my fault). So, if you have ever a similar problem you have to check the whole database content, not just those mentioned.
this error commnig if the enumeration column does not mach the value of column in the database, example: you defin in the database table status with column name {status1, status2, status3, status4} represent the java enum, and the enums status{status1, status2, status3} in this case the status1, status2 and status3 match values in the database, but the status4 does not match any value(does not exist), in this case this error will appear.