views:

114

answers:

1

I have a simple JPA @Entity that has a property of type java.util.Locale.

When I try and persist this, I get the following error:

java.lang.IllegalArgumentException: locale: java.util.Locale is not a supported property type. 
       at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue( DataTypeUtils.java:174) 
... 

In the appengine SDK (1.3.1), datanucleus-core-1.1.5.jar contains plugin.xml which contains the following type conversion "extension":

<java-type name="java.util.Locale" persistent="true" embedded="true" 
string-converter="org.datanucleus.store.types.LocaleStringConverter"/> 

How do I "activate" this type converter in my @Entity class?

A: 

This seems to be a significant limitation of Google's use of datanucleus. See the following (2nd last heading):

http://datanucleus.blogspot.com/2010/01/gaej-and-jdojpa.html

jnorris