Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate Entitymanager - what does it mean by "deprecated - use hibernate-core instead"?

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

like image 528
Ryan Aleksander Avatar asked Aug 01 '16 14:08

Ryan Aleksander


People also ask

Is hibernate deprecated?

No, Hibernate is not deprecated.

What is the use of EntityManager in JPA?

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.

Why is EntityManager needed?

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.


1 Answers

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.

like image 111
Aleksandr Podkutin Avatar answered Oct 12 '22 22:10

Aleksandr Podkutin