开发者

How to activate datanucleus java-type extensions for JPA?

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 contain开发者_运维技巧s 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜