Chapter 3. Building Queries with Spring Data JPA

We have learned how we can configure Spring Data JPA and implemented a simple CRUD application. Now it is time that we learn some skills that will help us to implement real-life applications. In this chapter, we will cover:

  • How we can use query methods for creating queries
  • How we can create dynamic queries by using the JPA Criteria API
  • How we can use Querydsl for creating dynamic queries
  • How we can sort and paginate query results

In the course of this chapter, we will extend our contact manager application by adding a search function to it. The requirements of the search function are as follows:

  • The search function must return all contacts whose first name or last name start with the given search term ...

Get Spring Data 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.