Joda-Time Hibernate PersistentYearMonthDay 已弃用
在查看 Joda-Time Hibernate 用户指南 时,似乎有未来不再支持 SQL DATE 类型。由于 TIMESTAMP 被指定为从 1970 年 1 月 1 日开始 - 1970 年之前日期的唯一安全传输似乎是 VARCHAR 和 PercientLocalTimeAsString(如果希望将自己限制在 Joda Hibernate 库中)。
作为使用 DATE 的人(并且看到 Joda Hibernate 不是),我想知道是否有某种原因我应该切换到 VARCHAR 和 PersistentLocalTimeAsString。 IE。是什么促使我们决定弃用 PersistentYearMonthDay?
In looking through the Joda-Time Hibernate user guide it appears that there is no future support for the SQL DATE type. Since TIMESTAMP is specified to start on Jan 1, 1970 - the only safe transport for dates before 1970 appears to be VARCHAR with PersistentLocalTimeAsString (if one wishes to restrict themselves to the Joda Hibernate library).
As someone who uses DATE (and seeing that Joda Hibernate isn't) I am wondering if there is some reason I should switch to VARCHAR and PersistentLocalTimeAsString. Ie. what motivated the decision to deprecate PersistentYearMonthDay?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它不是从 1970 年开始,它是一个零点,但它可能是负数。弃用
PersistentYearMonthDay
的原因是弃用年月日
。动机是“使用 LocalDate,它具有更好的内部实现,并且自 1.3 起就可用”另外,这很奇怪,但是 PersistentLocalDate 的源代码具有
DATE
sql 类型,而用户指南显示TIMESTAMP
,请尝试一下,也许只是用户指南中的拼写错误。It doesn't start on 1970, it's a zero point, but it could be negative. The reason why the
PersistentYearMonthDay
deprecated is deprecation ofYearMonthDay
. Motivated as "Use LocalDate which has a much better internal implementation and has been available since 1.3"Also, it's weird, but the source code for the PersistentLocalDate has
DATE
sql type, while the user guide saysTIMESTAMP
, try it, maybe just a typo in the user guide.0 设置为 1970 年 1 月 1 日,但这并不意味着不支持之前的日期。
The 0 is set to the 1st Jan. 1970, but that doesn't mean that dates before aren't supported.