Elite Club Search Feature
Enhance Elite Club application with custom query leveraging knowledge from the previous lesson.
In the previous chapter, we learned how to build queries and fetch data from DB using various techniques.
In this chapter, we are going to utilize our knowledge and implement a search feature.
To implement our feature we will use the @Query
annotation technique. There are two reasons for that:
- As per our requirements, the search should be case insensitive. The Named Method approach does not have a mechanism to distinguish between lower and upper case column values, thus we cannot use this approach.
- Named Query and
@Query
annotations are similar but, I personally prefer@Query
annotation because it it is the midpoint between the other two approaches. Moreover, the visibility of the query in the repository on the top of the method gives us easy navigation and debuggability.
Feature implementation
To implement our feature, we are required to perform the following ...