title: Incompatible types List and Page
body: <p>I am developing a webapp using JHipster that manages payments and wanted to filter the payments that a user can see so he can only see his payments. To do this I was following the <a href="https://youtu.be/ZGF4gEM4FuA?t=811" rel="nofollow noreferrer">blog tutorial</a> from Matt Raible on Youtube. He uses findByUserIsCurrentUser() which is generated by JHipster. </p>
  
  <pre><code>List&lt;Blog&gt; blogs = blogRepository.findByUserIsCurrentUser();
  </code></pre>
  
  <p>When I went to make the same change in my project I found the type that I must return is a Page and I get an incompatible type error, here is my method:</p>
  
  <pre><code>public Page&lt;Payment&gt; findAll(Pageable pageable) {
      log.debug("Request to get all Payments");
      Page&lt;Payment&gt; result = paymentRepository.findByUserIsCurrentUser();
      return result;
  }
  </code></pre>
  
  <p>If I change the findAll(pageable) for findByUserIsCurrentUser() which is declared in the PaymentRepository as follows</p>
  
  <pre><code>public interface PaymentRepository extends JpaRepository&lt;Payment,Long&gt; {
      @Query("select payment from Payment payment where payment.user.login = ?#{principal.username}")
      List&lt;Payment&gt; findByUserIsCurrentUser();
  }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/xZqOT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xZqOT.png" alt="Error"></a></p>
  
  <p>How can I solve this?</p>