Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

similarity and difference between jpa and hibernate

what is similarity and difference between jpa and hibernate.

like image 478
Satya Avatar asked Nov 20 '09 12:11

Satya


People also ask

What is the difference between spring JPA and hibernate?

JPA uses EntityManager interface to create/read/delete operation and maintains the persistence context. Hibernate uses Session interface to create/read/delete operation and maintains the persistence context. JPA uses JPQL (Java Persistence Query Language) as Object Oriented Query language for database operations.

Can we use both JPA and hibernate?

You cant actually use both of them in the same application. For backwards compatibility. We are expanding our application and want to start using Spring Data JPA, but still keep the old hibernate implementation. Its better you develop your new application as a separate microservice and use spring data jpa ..

What is the advantage of hibernate over JPA?

JPA is a standard, while Hibernate is not. In hibernate, we use Session for handling the persistence of data, while in JPA, we use Entity Manager. The query language in Hibernate is Hibernate Query language, while in JPA, the query language is Java Persistence query language. Hibernate is one of the most JPA providers.

What is difference between JPA and data JPA?

As we saw above, JPA is a standard for defining the persistence layer and Spring Data JPA is a sub-project under the Spring Framework umbrella which allows Spring applications to integrate with JPA.


1 Answers

JPA (Java Persistence API) is an interface for persistence providers to implement. Hibernate is one such implementation of JPA.

like image 70
Jeff Foster Avatar answered Sep 23 '22 07:09

Jeff Foster