title: Spring Data JPA dynamic projection with Paging
body: <p>We have a repository where we would like to use a dynamic projection with a paging:</p>
  
  <pre><code>@Repository
  public interface PersonRepository extends JpaRepository&lt;Person, Long&gt; {
      @Query("select p from Person p")
      &lt;T&gt; Page&lt;T&gt; dynamicInterfaceProjection(final Class&lt;T&gt; projectionClass, final Pageable pageable);
  }
  </code></pre>
  
  <p>But when we call it, we get the following exception:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Unknown parameter position: 1
      at org.hibernate.query.internal.QueryParameterBindingsImpl.getBinding(QueryParameterBindingsImpl.java:240) ~[hibernate-core-5.2.11.Final.jar:5.2.11.Final]
      at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:503) ~[hibernate-core-5.2.11.Final.jar:5.2.11.Final]
      at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:104) ~[hibernate-core-5.2.11.Final.jar:5.2.11.Final]
      at org.springframework.data.jpa.repository.query.ParameterBinder.bind(ParameterBinder.java:141) ~[spring-data-jpa-1.11.7.RELEASE.jar:na]
      at org.springframework.data.jpa.repository.query.StringQueryParameterBinder.bind(StringQueryParameterBinder.java:61) ~[spring-data-jpa-1.11.7.RELEASE.jar:na]
      at org.springframework.data.jpa.repository.query.ParameterBinder.bind(ParameterBinder.java:101) ~[spring-data-jpa-1.11.7.RELEASE.jar:na]
  </code></pre>
  
  <p>Obviously, Spring Data JPA doesn't recognize the second <strong>Pageable</strong> parameter. Switching parameters order results in the same exception.</p>
  
  <p>Are we doing something wrong? Is this even supported?</p>