O'Reilly logo

Spring Data by Petri Kainulainen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Adding Custom Functionality to JPA Repositories

We have learned how we can manage our entities and create database queries with Spring Data JPA. We have also learned how we can sort and paginate query results. However, if we take a purist architectural point of view, we notice that the described solutions are not following the separation of concerns principle. In fact, our service layer contains code that reveals the inner workings of our repository layer.

This is a trade off between architectural purity and productivity. As always, this choice has some consequences. If we have to migrate our application away from Spring Data JPA, we have to make changes to both the service and repository layer. However, how many times have we heard ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required