©  Raj Malhotra 2019
Raj MalhotraRapid Java Persistence and Microserviceshttps://doi.org/10.1007/978-1-4842-4476-0_4

4. Common Use Cases with JPA

Raj Malhotra1 
(1)
Faridabad, Haryana, India
 
So far, we have seen the basic setup of JPA along with Spring Data. In this chapter, we go through typical industry use cases and solutions with Spring Data JPA:
  • Multi datasource interaction

  • Solving the N+1 problem

  • Native queries with results mapped to DTOs using constructor

  • Native queries with results mapped to projections

  • The Spring Converter Service role in native queries

  • Concepts like entity lifecycle, ACID properties, CAP Theorem, and isolation levels

We will be creating a new application called eshop in this chapter. All subsections of this chapter update the ...

Get Rapid Java Persistence and Microservices: Persistence Made Easy Using Java EE8, JPA and Spring now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.