I was following a hibernate jpa tutorial, and I needed to use the entitymanager. But when I checked the mvnrepository, it said "deprecated - use hibernate-core instead". And apparently, my application would not work without hibernate-entitymanager as a dependency (and it would not work with both hibernate-core and hibernate-entitymanager as dependencies).
Can someone help explain why it's "deprecated"? https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager
No, Hibernate is not deprecated.
In JPA, the EntityManager interface is used to allow applications to manage and search for entities in the relational database. The EntityManager is an API that manages the lifecycle of entity instances. An EntityManager object manages a set of entities that are defined by a persistence unit.
The EntityManager API is used to access a database in a particular unit of work. It is used to create and remove persistent entity instances, to find entities by their primary key identity, and to query over all entities.
It means that in new version of Hibernate hibernate-entitymanager
component is deprecated and all functionality that you need, you can get from hibernate-core
component. Link to last version of hibernate-core
component in Maven Central Repository here. Add this dependency to your pom.xml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With