5.2.3 JPA provider

The JPA provider is a JPA implementation that provides the following mapping functionality, API, and query language. The following functionality is provided with the JPA provider:

The advantage of using the JPA provider is that you can design an application without knowing the processing related to database exchanges. Also, by using the query language JPQL available with the JPA provider, you can also send a query even if you are unfamiliar with the database.

The following figure shows the mapping functionality provided by JPA providers.

Figure 5-3 Overview of the mapping functionality provided by JPA providers

[Figure]

This subsection describes the above figure.

An entity class is prepared in the application and an entity object is generated from the entity class. By changing the contents of the entity object, the user changes the database contents. As a result, the user can update the database contents without knowing the database processing.

The JPA provider maps the entity objects to the database records. The JPA provider also executes the search, insert, delete, or update processing implemented by the user for the database.

The generated entity object is managed by EntityManager. If the value of an entity object field is changed, EntityManager automatically detects the change and applies the change to the database table.

During the following processing, EntityManager is invoked:

For details on EntityManager, see 5.4 EntityManager.