1

我正在尝试使用 Hibernate 保留 JODA LocalDate 属性。

@Column(nullable = false)
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
private DateTime scheduledDepartureTime;

我下载了以下罐子:

usertype.jodatime-2.0.1.jar
usertype.spi-3.0.0.GA.jar
usertype.core-3.0.0.GA.jar

并将它们添加到我的类路径中。

尝试执行我的应用程序时,我得到

java.lang.ClassNotFoundException: org.jadira.usertype.dateandtime.shared.spi.AbstractSingleColumnUserType

在 Eclipse 中搜索这个类的时候可以找到,但是它位于 中 org.jadira.usertype.shared.spi,这就解释了 Exception

知道为什么在错误的包中搜索此类吗?由于我使用的是这些 jar 的最新版本,我怀疑这来自版本问题。

谢谢你的帮助 !

4

1 回答 1

2

usertype.core-3.0.0.GA.jar包含org.jadira.usertype.dateandtime.joda.PersistentDateTime您需要的。
仅使用两个依赖项:

usertype.spi-3.0.0.GA.jar
usertype.core-3.0.0.GA.jar
于 2013-02-19T07:50:02.213 回答