From JPA to the database

JPA let's you represent your database in plain Java. Said otherwise it let's you represent the relational model as an object model. It is very common for the development and maintenance but at some point, and in particular when you will validate your performances, you will need to check what the mapper (JPA implementation) is doing and how it does translate your object code/model to the relational one (SQL).

When you check the JPA caller code, you often have something like the following:

final Quote quote = entityManager.find(Quote.class, id);....entityManager.persist(quote);

For more complex queries, it is like the following:

final Number count = entityManager.createQuery("select count(q) from Quote q", Number.

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.