Я следовал http://terasolunaorg.github.io/guideline/1.0.x/en/ArchitectureInDetail/Pagination.html реализовать поддержку PAGINATION для моего приложения MVCвыгружаемого поддержка Spring Data JPA, имеющие JNDI посмотреть на EntityManagerFactory
Когда я пытаюсь запустить JBoss сервер,
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.
Я пытался следовать, http://forum.spring.io/forum/spring-projects/data/99613-you-cannot-use-pageable-as-method-parameter-if-your-persistence-provider-cannot-extra
Но я не знаю, как применить предложенную конфигурацию EntityManagerFactory
as my jpa-config.xml содержит
<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:jboss/pu/pc" />
Любое другое лучшее предложение более чем приветствуется!
Environment:
JBoss Enterprise Application Platform - Версия 6.2.0.GA
весна-данных JPA-1.4.3.RELEASE.jar
спящий режим -jpa-2.0-api-1.0.1. Final-redhat-2.jar
standalone.xml содержит:
<datasource jndi-name="java:jboss/datasources/pc" pool-name="pcdatapool" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:@localhost:1521:mysid</connection-url>
<driver>oracle</driver>
<security>
<user-name>XXX</user-name>
<password>xxx</password>
</security>
</datasource>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
<persistence-unit name="pcem">
<jta-data-source>java:jboss/datasources/pc</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
<class>xxx.YYYYY</class>
...
<class>yyyy.AAAAAAAAAA</class>
<properties>
<property name="hibernate.jdbc.batch_size" value="50" />
<property name="hibernate.default_batch_fetch_size" value="50" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<!-- Use log category 'org.hibernate.SQL' to level 'debug' to output SQL from hibernate -->
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false"/>
<!-- Use generate statistics this will help query performance tunning -->
<property name="hibernate.generate_statistics" value="false"/>
</properties>
</persistence-unit>
Как настроить JpaDialect? –
Только что обновил мой пример .... Обратите внимание на изменение идентификатора jee: jndi-lookup –
Спасибо за ваше обновление. Добавил в вопрос мой persistence.xml. Если я понял ваш ответ, я думаю, что в persistence.xml может покончить с использованием META-INF/orm.xml mapping-file> –