Introduction to the Jakarta Persistence API



In this article, we will take a look at JPA's introduction.  JPA stands for Jakarta Persistence API (JPA), formerly known as Java Persistence API.

Before understanding JPA, let's first understand what is ORM?

What is ORM?

Object-relational mapping or ORM is the programming technique to map application domain model objects to the relational database tables.
For example, let's look at below diagram shows the mapping between the Student java model and the database relational student table:

YouTube Video - What is ORM?

ORM explained in-detail in below video:

What is JPA?

JPA is just a specification that facilitates object-relational mapping to manage relational data in Java applications. It provides a platform to work directly with objects instead of using SQL statements.

JPA defines only specifications, it does not provide an implementation. JPA implementation is provided as a reference implementation by the vendors developing O/R Mappers such as Hibernate, EclipseLink, and Apache OpenJPA.
JPA permits the developer to work directly with objects rather than with SQL statements. The JPA implementation is typically called persistence provider.

YouTube Video - What is JPA?

JPA explained in-detail in below video:

JPA Providers

JPA is an open-source API, therefore various enterprise vendors such as Oracle, Redhat, Eclipse, etc. provide new products by adding the JPA persistence flavor to them. Some of these products include:
Hibernate, EclipseLink, TopLink, MyBatis, etc.
Hibernate is the most popular ORM framework and implementation of JPA. You can learn the complete hibernate framework at Hibernate Tutorial

What are the advantages of JPA?

The advantages of JPA are given below.
  • We no need to create SQL statements if we use JPA. We directly persist an object into the database.
  • The burden of interacting with the database reduces significantly by using JPA
  • The user programming becomes easy by concealing the O/R mapping and database access processing
  • The cost of creating the definition file is reduced by using annotations
  • We can merge the applications used with other JPA providers
  • Using different implementations can add the features to the standard Implementation which can later be the part of JPA specification

What's Next?

In the next article, we will learn how to create a JPA entity.

You can learn complete JPA at JPA Tutorial - Java Persistence API

Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours


Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course

Comments