title: Clean way of creating dynamic queries from request parameters
body: <p>I am using Spring MVC 3.2 and I use JPA for my persistence layer. I would like to do the following:</p>
  
  <p>When a request like this arrive <code>/some-item?param1=something&amp;param2=123&amp;order-by=some-field</code> I want to be able to automatically build a query in the persistence layer so that I don't have to create one billion methods for <code>getAllItemsWith(final String param1, final String param2...)</code> and so on.</p>
  
  <p>I have thought of capturing the request parameters in a <code>Map</code> and then pass this to the repository layer where I have a predefined list of params that I will check if exists in the map, and if it does add the necassaray condition. However, I wonder if there are other better ways to do this?</p>