简体   繁体   English

如何使用DataNucleus查询/保留joda-time DateTime字段

[英]How to query/persist joda-time DateTime field using DataNucleus

I recently switched to DataNucleus and noticed that a joda-time DateTime field declared in an entity is not getting persisted. 最近,我切换到DataNucleus,并注意到实体中声明的joda-time DateTime字段没有保留。 I get the following error: 我收到以下错误:

Field 'time' is not marked as persistent so cannot be queried.

It is not clear from the documentation if I need to annotate this field or do something else to mark it as persistent. 从文档中尚不清楚我是否需​​要对此字段进行注释或需要执行其他操作以将其标记为持久性。

Any pointers? 有指针吗?

The DN docs say that types not specified in the JPA spec (eg org.joda.*) are not persistent by-default. DN文档说,默认情况下,JPA规范中未指定的类型(例如org.joda。*)不是持久性的。 So annotate them with something like @Basic and they ought to be picked up. 因此,使用@Basic这样的注释它们,应该将其拾取。 See our tests and samples if in doubt 如有疑问,请参阅我们的测试样品

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM