title: How do I filter data in a restful way using Spring?
body: <p>As the title says.</p>
  
  <p>I basically would love to do requests like</p>
  
  <pre><code>/api/todos/?completed=eq.true&amp;created_at=lt.1486462109399
  </code></pre>
  
  <p>Is there any ready <code>spring way</code> of achieving such? Something akin to the Page/Pageable mechanism would be great. </p>
  
  <p>If there is none I think I could implement it using Hibernate Criteria Queries &amp; Argument Re-solvers. Basically allowing me to write my controllers like</p>
  
  <pre><code> @GetMapping
   public ResponseEntity&lt;Page&lt;TodoDTO&gt;&gt; listAll(Criteria criteria, Pageable pageable) 
   {
          Page&lt;Todo&gt; todos = todoService.listAll(criteria, pageable)
          ...
   }
  </code></pre>
  
  <p>A custom Argument resolver would be responsible for turning the query string into a Criteria. Not quite sure yet how I would handle it within the service but that's the direction in which I would try to implement this.</p>
  
  <p>Would that be a good approach? Any recommendations? (All assuming there are no ready mechanism for such already).</p>
  
  <p>Your help is much appreciated.</p>