且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用usertype在JPA中使用Hibernate持久化JSR 310 java.time.LocalDateTime

更新时间:2023-01-17 08:26:34

它不工作,因为你使用错误类型。您应该使用 org.jadira.usertype.dateandtime.threeten.PersistentLocalDateTime 而不是 org.jadira.usertype.dateandtime.threetenbp.PersistentLocalDateTime 用于JSR-310类。

您不需要 org.threeten:threetenbp:0.9 依赖项。

It does not work because you are using the wrong type. You should use org.jadira.usertype.dateandtime.threeten.PersistentLocalDateTime instead of org.jadira.usertype.dateandtime.threetenbp.PersistentLocalDateTime for the JSR-310 classes.
You don't need the org.threeten:threetenbp:0.9 dependency.