Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Spring Data
  • Table Of Contents Toc
  • Feedback & Rating feedback
Spring Data

Spring Data

By : Petri Kainulainen
4.5 (8)
close
close
Spring Data

Spring Data

4.5 (8)
By: Petri Kainulainen

Overview of this book

Spring Framework has always had a good support for different data access technologies. However, developers had to use technology-specific APIs, which often led to a situation where a lot of boilerplate code had to be written in order to implement even the simplest operations. Spring Data changed all this. Spring Data makes it easier to implement Spring-powered applications that use cloud-based storage services, NoSQL databases, map-reduce frameworks or relational databases. "Spring Data" is a practical guide that is full of step-by-step instructions and examples which ensure that you can start using the Java Persistence API and Redis in your applications without extra hassle. This book provides a brief introduction to the underlying data storage technologies, gives step-by-step instructions that will help you utilize the discussed technologies in your applications, and provides a solid foundation for expanding your knowledge beyond the concepts described in this book. You will learn an easier way to manage your entities and to create database queries with Spring Data JPA. This book also demonstrates how you can add custom functions to your repositories. You will also learn how to use the Redis key-value store as data storage and to use its other features for enhancing your applications. "Spring Data" includes all the practical instructions and examples that provide you with all the information you need to create JPA repositories with Spring Data JPA and to utilize the performance of Redis in your applications by using Spring Data Redis.
Table of Contents (13 chapters)
close
close

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

  • The search must be case insensitive

  • The search results must be sorted in ascending order by using the last name and first name

  • The search function must be able to paginate search results

We will also learn to sort and paginate the contact list shown on...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Spring Data
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon