Model and implications

This section does not intend to go through all the cases; other books centered on JPA do it very well. In order to avoid doing things that can have a negative impact on the performances, this part will show you that the abstraction JPA does need some attention.

To illustrate this statement, we will reuse the Customer/Quote relationship. As it is @ManyToMany, it relies on a join table. Here is a representation of the model:

The use case is when you want to access the other side of the relationship: Quotes from a Customer (getQuotes()) or the opposite (getCustomers().size()).

Here, the provider will find all the entities ...

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.