enums - JPA @Enumerated Error -


I have existence with the field that I want to become an enum.

@ column (name = "TEMPRATURE_ZONE") @ Nominated (STRING) private temperature range tempratureZone;

Enum is defined as follows:

  public enum TemperatureRegime {environment, cool}  

data EclipseLink-116: EclipseLink-116] (Eclipse Stubbornness: My Table Always For The Area "Ambient" or "Cold" So far, when I get the following exception on a findAll query table Services - 2.1.0.v20100614-r7608): org.eclipse.persistence.exceptions.DescriptorException exception details: Any conversion value provided for the price [chill] in the area [LOCATION_GROUP.TEMPRATURE_ZONE]. Mapping: org.eclipse.persistence.mappings.DirectToFieldMapping [tempratureZone - & gt; LOCATION_GROUP.TEMPRATURE_ZONE] Descriptor: RelationalDescriptor (com.company.location.LocationGroup -> [DatabaseTable (LOCATION_GROUP)])

I can not see what the problem is, any thoughts?

Cheers,

James

I believe That's just a matter of issue, your NUM defines CHILL, while the value of the database is chill. The simplest solution should be to change the enum definition to match the database value

Alternatively I handle a converter approach enum values ​​to handle database wire documents exactly.

Doug


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -