What is the relationship between JPA and ORM?

Asked

Viewed 1,363 times

7

I wanted to know the relationship between JPA and ORM because I was in doubt, if both ,.

2 answers

8

To Java Persistence API (JPA - Java Persistence API) is a specification of how the Object-Relational Mapping (ORM - Object-Relational Mapping) should be implemented on the Javaee platform.

Therefore:

  • ORM is a general concept
  • JPA defines a ORM pattern, that is, how it should work in Java in practice
  • Hibernate, Eclipselink, Toplink, Openjpa are implementations of the JPA standard
  • 1

    Thank you! It helped a lot!!

6


Summary: JPA is a specification and ORM is the tool (Hibernate, Entity, etc).

In the context of Java applications, to facilitate the process of transforming the data that moves between applications and databases, we can use some persistence tools such as Hibernate or the Eclipselink.

These tools act as intermediaries between applications and databases, automating several important processes related to data persistence. They are called tools ORM (Object Relational Mapping).

In order to facilitate the use of these tools and make them compatible with the other features of the Java platform, they are standardized by the specification Java Persistence API (JPA).

Source: Java Workbook - Persistence with JPA 2 and Hibernate

  • 1

    "ORM is the tool (Hibernate..." - This is weird. ORM is not a tool but a concept, and Hibernate is the tool that implements the concept. See the answer to utluiz.

  • So I put in parentheses to indicate that Hibernate, Entity are a ORM tool.

Browser other questions tagged

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