Doubt JPA 2.1 and Hibernate 5.2

Asked

Viewed 129 times

0

I have some questions with JPA 2.1 and Hibernate 5.2. The last version of the JPA booth is 2.1. Right? Is it correct to say that I can implement a JPA-only AP without Ibernate? What are the features of Hibernate 5.2 that are outside the JPA 2.1 booth? Hibernate 5.2 supports Nosql? What are the advantages of using JPA against Hibernate?

1 answer

0

Yes, you don’t need Hibernate to use JPA, but you will need another ORM framework similar to Hibernate like Eclipselink, Toplink, etc.

The framework is the implementation of the JPA specification, that is, the JPA is like an interface and the framework is the class that implements the interface. So you’ll always need a ORM framework to work with JPA.

JPA 2.1 is the latest version of the JPA specification, although Hibernate constantly changes version it always follows the rules necessary to work with JPA version 2.1. What changes between versions are bug fixes, performance improvements and other own resources of the framework itself that may not even exist in JPA.

About the advantages between Hibernate and JPA is that JPA is a specification and any framework that implements the specification is able to be used by it. In this case, if you use JPA with Hibernate, tomorrow you can replace Hibernate with Eclipselink without much effort. You will only need to change a few instructions in the JPA configuration file. If you work 100% with Hibernate, without JPA, if you decide to switch to Eclipselink tomorrow, you will need to change the configuration of the framework and also the writing and reading methods and also the entity mappings. The effort in this exchange would be very high.

Hibernate has a version called, GMO hibernate which is used to work with some non-relational databases (Nosql).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.