Am I Confused by Hibernate?

I recognized JPA for ORM. Now I will be asked to use Hibernate as my provider. If I start with Hibernate, this will be replaced by a different concept. Please tell me how I can bind JPA and sleep mode together. JPA shortens my Java code to simple code for persistent objects. Now, what hibernation helps JPA and what does it provide. Anyone please explain simply.

+4
source share
3 answers

Sleep mode is not another concept; This is just one of many JPA implementations. Another will be EclipseLink. If you and the implementation adhere to the specification, then switching the implementation is just changing a couple of lines in your persistence.xml (for example, the <provider> and specific properties of the implementation). At least theoretically ...

+2
source

How Pascal answered here

JPA is just an API. To use JPA, you need an implementation of this API, and such implementations are called continuity providers (EcliseLink, Hibernate, OpenJPA)

+3
source

JPA is an API specification for persistent objects. It defines the SQL query language and annotations to define entities and relationships.

Hibernate is a JPA implementation that has various extensions, as well as an outdated API and query language. As long as you do not use any Hibernate extensions and adhere to the JPA API, you can more or less consider it interchangeably with other JPA implementations such as OpenJPA, TopLink, etc.

+2
source

All Articles