0

是否可以在谷歌应用引擎中的 jpa 实体上使用 jodatime 注释,例如在 org.hibernate.annotations.Type 中使用 org.jadira.usertype.dateandtime.joda.PersistentDateTime ?

第一个日志:

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
4

1 回答 1

2

什么是“jodatime 注释”?您的意思是您可以将 JodaTime 类型持久保存到 AppEngine 吗?由于 AppEngine 使用 DataNucleus JPA 作为其提供者,并且由于 DataNucleus JPA 还为主要的 JodaTime 类型提供了一个插件,所以是的。

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

于 2012-12-05T05:52:44.090 回答