title: Spring Data: limit result for custom query
body: <p>In my Spring Data repository I (have to) use custom queries using the <code>@Query</code> annotation. I know I can limit the number of results in a named query like that</p>
  
  <p><code>Iterable&lt;Person&gt; findFirst5OrderByLastName()</code></p>
  
  <p>or that it is possible to limit the number of results by passing a pageable like that</p>
  
  <p><code>Iterable&lt;Person&gt; findByLastName(String lastName, Pageable pageable)</code></p>
  
  <p>But is it possible to achieve the same when using a custom <code>@Query</code> annotation?</p>
  
  <p>TIA</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>as I see my question is a little confusing, some clearification:
  What I want is to limit the number of the results I get, when using a custom query, so that I neither</p>
  
  <p>1) need to specify the result-size through a pageable</p>
  
  <p>2) need to use a named query to specify the result-size</p>
  
  <p>In fact I want the limitation of the number of results to be completely transparent when invoking method (hence not passing a <code>Pageable</code>) and to not rely on the naming-scheme of Spring Data (as the meaning/function of the method is best conveyed through a custom name)</p>