Doubt JPA 2.1 and Hibernate 5.2

0

I have some doubts with JPA 2.1 and Hibernate 5.2. The latest version of the JPA standard is 2.1. Right? Is it correct to say that I can implement an AP only with JPA without hibernate? What are the features of hibernate 5.2 that are outside the JPA 2.1 standard? Does Hibernate 5.2 support NoSQL? What are the advantages of using JPA versus hibernate?

    
asked by anonymous 03.07.2017 / 22:23

1 answer

0

Yes, you do not need Hibernate to use JPA, but you will need another framework similar to Hibernate like EclipseLink, TopLink, etc.

The framework is the implementation of the JPA specification, that is, JPA is like an interface and the framework is the class that implements the interface. So you'll always need an 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 the JPA 2.1 release. What changes between versions are bug fixes, performance improvements, and other framework-own features that may not even exist in JPA.

On the advantages between Hibernate and JPA is that JPA is a specification and any framework that implements the specification is apt to be used by it. In this case, if you use JPA with Hibernate, you can replace Hibernate with EclipseLink without much effort. You will just need to change some 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 as well as the methods of writing and reading and also the mapping of entities. The effort in this exchange would be very high.

Hibernate has a version called, Hibernate OGM that is used to work with some non-relational databases (NoSQL).

    
08.08.2017 / 23:01