Why is hibernate-java8 (hibernate 5.x) jar shown deprecated?

喜夏-厌秋 提交于 2021-02-07 11:59:56

问题


Hibernate 5 and above supports Java8 DateTime Api through jar "hibernate-java8".
But the MavenRepository shows a message Deprecated - use hibernate-core instead) alongside the title of the hibernate-java8 jar.

Why is the hibernate-java8 jar called deprecated even though it is required to gain the hibernate support for java8?


回答1:


You can see the Migration Guide for Hibernate. It specifies that

Hibernate 5.2 is built using Java 8 JDK and will require Java 8 JRE at runtime (we are investigating whether Java 9 will also work). This has a number of implications:

The hibernate-java8 module has been merged into hibernate-core and the Java 8 date/time types are now natively supported.

(todo) support for Java 8 Optional

(todo) support for other Java 8 features?

The hibernate-java8 module has been removed; that functionality has been consolidated into hibernate-core.

For hibernate-java8 see this ticket for explanation,

As this relies on Java 8 and Hibernate still maintains compatibility back to Java 6, a new module hibernate-java8 was added to isolate the Java 8 compatibility to just these classes. We will fold the classes from this module into hibernate-core once we baseline one Java 8.

Since hibernate no longer maintains the hibernate-java8 and you can see that hibernate-java8 is nothing more than an empty placeholder. Github & JIRA Detail.

So, As the functionality has been merged into hibernate-core; hibernate-java8 now is depreciated.

I hope this answer your queries.



来源:https://stackoverflow.com/questions/39761619/why-is-hibernate-java8-hibernate-5-x-jar-shown-deprecated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!