DATAJPA-1163 - Polishing.
Reduced visibility of newly introduced method. Moved method for test into inner class of the test Original pull request: #283.
This commit is contained in:
@@ -68,7 +68,7 @@ class ExpressionBasedStringQuery extends StringQuery {
|
||||
* @param parser Parser for resolving SpEL expressions. Must not be {@literal null}.
|
||||
* @return A query supporting SpEL expressions.
|
||||
*/
|
||||
public static ExpressionBasedStringQuery from(DeclaredQuery query, JpaEntityMetadata metadata,
|
||||
static ExpressionBasedStringQuery from(DeclaredQuery query, JpaEntityMetadata metadata,
|
||||
SpelExpressionParser parser) {
|
||||
return new ExpressionBasedStringQuery(query.getQueryString(), metadata, parser);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ public class SimpleJpaQueryUnitTests {
|
||||
|
||||
when(em.createQuery(Mockito.anyString())).thenReturn(query);
|
||||
|
||||
Method method = UserRepository.class.getMethod("findAllWithExpressionInCountQuery", Pageable.class);
|
||||
Method method = SampleRepository.class.getMethod("findAllWithExpressionInCountQuery", Pageable.class);
|
||||
JpaQueryMethod queryMethod = new JpaQueryMethod(method, metadata, factory, extractor);
|
||||
|
||||
AbstractJpaQuery jpaQuery = new SimpleJpaQuery(queryMethod, em, "select u from User u", EVALUATION_CONTEXT_PROVIDER,
|
||||
@@ -281,6 +281,10 @@ public class SimpleJpaQueryUnitTests {
|
||||
|
||||
@Query("select u from User u")
|
||||
Collection<UserProjection> projectWithExplicitQuery();
|
||||
|
||||
@Query(value = "select u from #{#entityName} u", countQuery = "select count(u.id) from #{#entityName} u")
|
||||
List<User> findAllWithExpressionInCountQuery(Pageable pageable);
|
||||
|
||||
}
|
||||
|
||||
interface UserProjection {}
|
||||
|
||||
@@ -556,10 +556,6 @@ public interface UserRepository
|
||||
// DATAJPA-1334
|
||||
List<NameOnlyDto> findByNamedQueryWithConstructorExpression();
|
||||
|
||||
// DATAJPA-1163
|
||||
@Query(value = "select u from #{#entityName} u", countQuery = "select count(u.id) from #{#entityName} u")
|
||||
List<User> findAllWithExpressionInCountQuery(Pageable pageable);
|
||||
|
||||
interface RolesAndFirstname {
|
||||
|
||||
String getFirstname();
|
||||
|
||||
Reference in New Issue
Block a user