休眠5的jodatime兼容性问题

问题描述 投票:3回答:1

我无法在休眠5和Java 8中使用jodatime。

我正在将一个大型应用程序从spring4 / hibernate4 / java7迁移到spring5 / hibernate5 / java8。

春季5.0.5.RELEASEHibernate 5.2.16.Final

<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.9.9</version>
</dependency>
<dependency>
    <groupId>org.jadira.usertype</groupId>
    <artifactId>usertype.jodatime</artifactId>
    <version>2.0.1</version>
</dependency>

实体豆

@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
@Column(name="START_DATE")
private org.joda.time.LocalDate startDate;

由于现有代码,我无法使用java8时间库。我已经尝试过,但是最终带来了我可以管理的巨大改变。

任何人都有经验吗?

这是我启动时遇到的错误。

java.lang.AbstractMethodError
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:119)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:82)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2854)
hibernate jodatime localdate
1个回答
0
投票

您的org.jadira.usertype版本对于此版本的Hibernate来说太旧了。您至少需要5.0.0.GA或6.0.0.1.GA。

© www.soinside.com 2019 - 2024. All rights reserved.