Querying for Data
with Spring Boot
In the previous chapter, we learned how Spring Boot manages embedded servlet containers, automatically registers our web controllers, and even provides JSON serialization/deserialization, easing the creation of APIs.
What application doesn’t have data? Spoiler alert – none. That’s why this chapter is focused on learning some of the most powerful (and handy) ways to store and retrieve data.
In this chapter, we’ll cover the following topics:
- Adding Spring Data to an existing Spring Boot application
- DTOs, entities, and POJOs, oh my!
- Creating a Spring Data repository
- Using custom finders
- Using Query By Example to find tricky answers
- Using the custom Java Persistence API (JPA)
Being able to store and retrieve data is a critical need for any application, and this list of topics will provide you with vital abilities.
Where to find this chapter’s code
The source code for this...