开发者

How to activate datanucleus java-type extensions for JPA?

开发者 https://www.devze.com 2022-12-20 17:59 出处:网络
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:

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

精彩评论

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

关注公众号