So, what happens when the exact criteria for a query vary from request to request? In short, we need a way to feed Spring Data an object that captures the fields we’re interested in while ignoring the ones that we aren’t.
The answer is Query By Example.