Reputation: 297
After updating hibernate-core from 5.6.9.Final to 6.0.2.Final my javax.persistence.Entity imports couldn't resolve. I discovered the dependency to javax.persistence-api is removed in hibernate-core 6.0.2.Final.
In 5.6.9.Final it's still here: https://search.maven.org/artifact/org.hibernate/hibernate-core/5.6.9.Final/jar
In 6.0.2.Final it's gone: https://search.maven.org/artifact/org.hibernate/hibernate-core/6.0.2.Final/pom
Can anyone please explain why it is removed? Should I add it myself or is it missing (is it a bug) in 6.0.2.Final?
Upvotes: 5
Views: 7041
Reputation: 125292
Hibernate 6 is an implementation of the Jakarta Persistence API not the Java Persistence API. See also the initial release notes.
So no it is not a bug it is intended as there is no Java Persistence API after version 2.2, as the development/maintenance of the EE APIs has been moved from Oracle to a foundation. With the new releases the packages have also changed (due to legal implication) and those are now in jakarta.persistence
instead of javax.persistence
.
All this is also why there is en extensive migration guide for moving to Hibernate 6.
Upvotes: 7