title: Pagination with spring boot usiing jpa
body: <p>How can I implement a method that return a page of objects using JpaRepository and not PagingAndSortingRepository ?</p>
  
  <p>My repository</p>
  
  <pre><code>public interface GroupRepository extends JpaRepository&lt;Group, Long&gt; {   
      @Query(value = "SELECT g FROM Group")
      Page&lt;Group&gt; listAllByPage(Pageable pageable);
  }
  </code></pre>
  
  <p>My service implementation:</p>
  
  <pre><code>@Override
  public 
  Page&lt;Group&gt; findGroupesByPagination(Pageable pageable) {
      return groupeRepository.listAllByPage(pageable);
  }
  </code></pre>
  
  <p>My rest Controller method:</p>
  
  <pre><code>@RequestMapping(value="/groups", method = RequestMethod.GET)
  public @ResponseBody Page&lt;Group&gt; list( Pageable pageable){
      Page&lt;Group&gt; groupes = groupeServiceImpl.findGroupesByPagination(pageable);
      return groupes;
  }
  </code></pre>
  
  <p>Finally I got this error:</p>
  
  <blockquote>
    <p>Error creating bean with name 'groupServiceImpl': Unsatisfied
    dependency expressed through field 'groupeRepository'; nested
    exception is org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name 'groupRepository': Invocation of init
    method failed; nested exception is java.lang.IllegalArgumentException:
    Validation failed for query for method public abstract
    org.springframework.data.domain.Page
    rimtrack.org.repository.GroupRepository.listAllByPage(org.springframework.data.domain.Pageable)!</p>
  </blockquote>