* Add query creation test in JpaNamedQueryProviderTests
* Make JpaPagingItemReaderNamedQueryIntegrationTests consistent
  with JpaPagingItemReaderNativeQueryIntegrationTests
This commit is contained in:
Mahmoud Ben Hassine
2020-06-26 13:51:35 +02:00
parent 3b58fecfe4
commit 4e0d6a982b
5 changed files with 65 additions and 24 deletions

View File

@@ -39,7 +39,7 @@ public class JpaNamedQueryProvider<E> extends AbstractJpaQueryProvider {
@Override
public Query createQuery() {
return getEntityManager().createNamedQuery(namedQuery, entityClass);
return getEntityManager().createNamedQuery(this.namedQuery, this.entityClass);
}
/**
@@ -58,7 +58,7 @@ public class JpaNamedQueryProvider<E> extends AbstractJpaQueryProvider {
@Override
public void afterPropertiesSet() throws Exception {
Assert.isTrue(StringUtils.hasText(namedQuery), "Named query cannot be empty");
Assert.notNull(entityClass, "Entity class cannot be NULL");
Assert.isTrue(StringUtils.hasText(this.namedQuery), "Named query cannot be empty");
Assert.notNull(this.entityClass, "Entity class cannot be NULL");
}
}