title: Pageable support for Spring Data JPA having jndi look up for entityManagerFactory
body: <p>I was following <a href="http://terasolunaorg.github.io/guideline/1.0.x/en/ArchitectureInDetail/Pagination.html" rel="nofollow">http://terasolunaorg.github.io/guideline/1.0.x/en/ArchitectureInDetail/Pagination.html</a>  to implement Pagination support for my MVC application</p>
  
  <p>When I try to start the JBoss Server,</p>
  
  <pre><code>nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.repo.MyRepository.searchEntitySC(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.Date,java.lang.String,java.util.Date,java.lang.String,java.lang.String,java.lang.String,org.springframework.data.domain.Pageable)! 
  
  Reason: Your persistence provider does not support extracting the JPQL query from a named query thus you can't use Pageable inside your query method. Make sure you have a JpaDialect configured at your EntityManagerFactoryBean as this affects discovering the concrete persistence provider.
  </code></pre>
  
  <p>I tried to follow, <a href="http://forum.spring.io/forum/spring-projects/data/99613-you-cannot-use-pageable-as-method-parameter-if-your-persistence-provider-cannot-extra" rel="nofollow">http://forum.spring.io/forum/spring-projects/data/99613-you-cannot-use-pageable-as-method-parameter-if-your-persistence-provider-cannot-extra</a></p>
  
  <p>But I don't know how to apply the suggested configuration for entityManagerFactory</p>
  
  <p>as my jpa-config.xml contains</p>
  
  <pre><code>  &lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="java:jboss/pu/pc" /&gt;
  </code></pre>
  
  <p>Any other better suggestion is more than welcome!</p>
  
  <p><strong>Environment</strong>:</p>
  
  <ol>
  <li><p>JBoss Enterprise Application Platform - Version 6.2.0.GA</p></li>
  <li><p>spring-data-jpa-1.4.3.RELEASE.jar</p></li>
  <li><p>hibernate-jpa-2.0-api-1.0.1.Final-redhat-2.jar</p></li>
  </ol>
  
  <p>standalone.xml contains:</p>
  
  <pre><code>  &lt;datasource jndi-name="java:jboss/datasources/pc" pool-name="pcdatapool" enabled="true" use-ccm="false"&gt;
   &lt;connection-url&gt;jdbc:oracle:thin:@localhost:1521:mysid&lt;/connection-url&gt;
                  &lt;driver&gt;oracle&lt;/driver&gt;
                  &lt;security&gt;
                      &lt;user-name&gt;XXX&lt;/user-name&gt;
                      &lt;password&gt;xxx&lt;/password&gt;
                  &lt;/security&gt;
              &lt;/datasource&gt;
  </code></pre>
  
  <p><strong>persistence.xml</strong></p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_0.xsd"&gt;
      &lt;persistence-unit name="pcem"&gt;
         &lt;jta-data-source&gt;java:jboss/datasources/pc&lt;/jta-data-source&gt;
      &lt;mapping-file&gt;META-INF/orm.xml&lt;/mapping-file&gt;
      &lt;class&gt;xxx.YYYYY&lt;/class&gt;
       ...
      &lt;class&gt;yyyy.AAAAAAAAAA&lt;/class&gt;      
      &lt;properties&gt;
          &lt;property name="hibernate.jdbc.batch_size" value="50" /&gt;
          &lt;property name="hibernate.default_batch_fetch_size" value="50" /&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /&gt;
          &lt;!-- Use log category 'org.hibernate.SQL' to level 'debug' to output SQL from hibernate --&gt;
          &lt;property name="hibernate.show_sql" value="false" /&gt;
          &lt;property  name="hibernate.format_sql" value="false"/&gt;
          &lt;!-- Use generate statistics this will help query performance tunning  --&gt;
          &lt;property  name="hibernate.generate_statistics" value="false"/&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>