是否可以像在org.hibernate.annotations.Type中使用org.jadira.usertype.dateandtime.joda.PersistentDateTime一样在Google App引擎的jpa实体上使用jodatime注释?

第一个日志:

2012-12-06 23:26:25 org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
WARNING: Extension Point "org.datanucleus.type_converter" not registered, but plugin   "org.datanucleus.store.types.jodatime" defined in file:/C:/Dev/oms/workspace_gae/orders.management.system.gae/war/WEB-INF/lib/datanucleus-jodatime-3.1.1.jar refers to it.
2012-12-06 23:26:25 org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
WARNING: Extension Point "org.datanucleus.query_method_evaluators" not registered, but plugin "org.datanucleus.store.types.jodatime" defined in file:/C:/Dev/oms/workspace_gae/orders.management.system.gae/war/WEB-INF/lib/datanucleus-jodatime-3.1.1.jar refers to it.
2012-12-06 23:26:25 org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
WARNING: Extension Point "org.datanucleus.store.rdbms.sql_expression" not registered, but plugin "org.datanucleus.store.types.jodatime" defined in file:/C:/Dev/oms/workspace_gae/orders.management.system.gae/war/WEB-INF/lib/datanucleus-jodatime-3.1.1.jar refers to it.
2012-12-06 23:26:25 org.datanucleus.plugin.NonManagedPluginRegistry registerExtensions
WARNING: Extension Point "org.datanucleus.store.rdbms.sql_method" not registered, but plugin "org.datanucleus.store.types.jodatime" defined in file:/C:/Dev/oms/workspace_gae/orders.management.system.gae/war/WEB-INF/lib/datanucleus-jodatime-3.1.1.jar refers to it.
2012-12-06 23:26:25 org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints
SEVERE: Bundle "org.datanucleus.store.types.jodatime" requires "org.datanucleus" version "3.1.0.m1" but the resolved bundle has version "3.1.1" which is outside the expected range.


第二条日志

Caused by: java.lang.IllegalArgumentException: userRegisterDate: org.joda.time.DateTime is not a supported property type.
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:158)
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:124)
at com.google.appengine.api.datastore.Entity.setProperty(Entity.java:339)
at org.datanucleus.store.appengine.DatastoreFieldManager.storeObjectField(DatastoreFieldManager.java:847)
at org.datanucleus.state.AbstractStateManager.providedObjectField(AbstractStateManager.java:1037)
at pl.mlynarczyk.orders.management.system.model.User.jdoProvideField(User.java)
at pl.mlynarczyk.orders.management.system.model.User.jdoProvideFields(User.java)
at org.datanucleus.state.JDOStateManagerImpl.provideFields(JDOStateManagerImpl.java:2715)
at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess(DatastorePersistenceHandler.java:357)
at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:267)
at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:256)
at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:3185)
at org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4513)
at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814)
at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754)
at org.datanucleus.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:549)
at pl.mlynarczyk.orders.management.system.dao.UserDaoImpl.persistUser(UserDaoImpl.java:61)
at pl.mlynarczyk.orders.management.system.service.UserServiceImpl.registerUser(UserServiceImpl.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:114)
at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:109)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)
at org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:84)
at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:75)
at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)
at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
... 56 more

最佳答案

什么是“ jodatime注释”?您的意思是您可以将JodaTime类型保留到AppEngine吗?由于AppEngine使用DataNucleus JPA作为其提供程序,并且由于DataNucleus JPA还提供了plugin for the main JodaTime types,因此可以。

编辑:添加了链接到JodaTime插件

09-25 18:20