Spring Data is a great tool to implement database queries. We can just name a method the right way and it will get the data we want from the database. Or, we can write a custom query and put it into a @Query annotation for more complex use cases.
That's well and good, but it doesn't scale when we need very dynamic queries. The number of methods we have to build would grow exponentially. This new article is about Specifications, which provides an API on top of the Criteria API that helps us build atomic predicates that we can combine to queries dynamically.
|