title: Pagination in spring-data
body: <p>I have a requirement while querying a database using pagination.
  While pagination, I will give page size and page index to the query like shown below,</p>
  
  <pre><code>select distinct tp.* from kat_task_property tp inner join kat_task_to_workstream ttw on ttw.ttw_frn_task_id = tp.tp_frn_task_id and ttw.ttw_frn_workstream_id= :workStreamId and ttw.ttw_ended_by is null and tp.tp_ended_by is null and tp.tp_is_active=true and ttw.ttw_is_active=true left join kat_user_to_task_order kto on ttw.ttw_id = kto.uto_frn_task_to_workstream_id and kto.uto_frn_user_id = :userId order by tp.tp_completed_at ,kto.uto_order limit :index, :size
  </code></pre>
  
  <p>The sample result will be,</p>
  
  <pre><code>tp_id      tp_completed_at
   1          2017-02-27 06:47:52
   2          null
   3          null
   4           2017-03-14 12:59:24
   5          null
   6          null
   7          null
  </code></pre>
  
  <p>My requirement is when index is 0 in the query, I should get all the data where tp_completed_at is null irrespective of the value size has in the query. I mean, pagination should not be applied when index is zero and I should get all the entries with tp_completed_at is null. And, when index has value other than 0 pagination should apply. Please Help</p>