gpt4 book ai didi

java - jodatime 的 hibernate 自定义类型(版本冲突?)

转载 作者:行者123 更新时间:2023-11-30 09:09:06 24 4
gpt4 key购买 nike

我有一个具有以下属性的实体:

@Type(type = "org.joda.time.contrib.hibernate.PersistentDateTime")
protected DateTime time;

我得到以下错误

Caused by: java.lang.AbstractMethodError
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:158)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2843)

我正在使用 jboss wildfly,它使用的是 hibernate 4.3.1。我的耳朵里有 joda-time-2.3.jar 和 joda-time-hibernate-1.3.jar。这些版本是否无法正常协同工作?

最佳答案

网站上joda-time-hibernate声明该项目与 Hibernate 3.6 版相关,请参阅:

“请注意版本 1.3 适用于 Hibernate 3.6 而不是 Hibernate 4.0(因为 Hibernate 团队进行了另一个不兼容的更改)。usertype project 处理 Hibernate 4.0。它也比这个项目更新和更完整一般而言。”

关于java - jodatime 的 hibernate 自定义类型(版本冲突?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23196539/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com