Spring Data JPA
In this section, we will introduce Spring Data JPA, starting with a single database table, and then adding more entities and working with relationships between them. We will build OneToMany and ManyToOne relationships, both unidirectional and bidirectional. Additionally, we will look at how these relationships affect serialization to JSON, and how to avoid recursive structures using annotations or Data Transfer Objects (DTOs).
Before class
Practical requirements
Recommended reading and videos
- Read chapter 1-3 of the Spring Data JPA guide: 📄 Spring Data JPA slides (PDF)
- Java Records: https://www.baeldung.com/java-record-keyword
Extra resources
During class
We will use these 📄 Spring Data JPA Introduction (PDF) and you will have time to do the exercises.
Demos used in class:
- TBD
After class
Finish the exercises.