DATAJPA-1594 - Polishing.

Formatting and whitespace.
This commit is contained in:
Oliver Drotbohm
2019-08-28 14:32:22 +02:00
parent 62273d430d
commit 04d0aa140f
2 changed files with 8 additions and 10 deletions

View File

@@ -156,6 +156,7 @@ public class Querydsl {
private <T> JPQLQuery<T> addOrderByFrom(QSort qsort, JPQLQuery<T> query) {
List<OrderSpecifier<?>> orderSpecifiers = qsort.getOrderSpecifiers();
return query.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]));
}
@@ -234,12 +235,9 @@ public class Querydsl {
while (path != null) {
if (!path.hasNext() && order.isIgnoreCase()) {
// if order is ignore-case we have to treat the last path segment as a String.
sortPropertyExpression = Expressions.stringPath((Path<?>) sortPropertyExpression, path.getSegment()).lower();
} else {
sortPropertyExpression = Expressions.path(path.getType(), (Path<?>) sortPropertyExpression, path.getSegment());
}
sortPropertyExpression = !path.hasNext() && order.isIgnoreCase() //
? Expressions.stringPath((Path<?>) sortPropertyExpression, path.getSegment()).lower() //
: Expressions.path(path.getType(), (Path<?>) sortPropertyExpression, path.getSegment());
path = path.next();
}

View File

@@ -64,7 +64,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
/**
* Creates a new {@link QuerydslJpaPredicateExecutor} from the given domain class and {@link EntityManager} and uses
* the given {@link EntityPathResolver} to translate the domain class into an {@link EntityPath}.
*
*
* @param entityInformation must not be {@literal null}.
* @param entityManager must not be {@literal null}.
* @param resolver must not be {@literal null}.
@@ -121,7 +121,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
return executeSorted(createQuery(predicate).select(path), orders);
}
/*
/*
* (non-Javadoc)
* @see org.springframework.data.querydsl.QuerydslPredicateExecutor#findAll(com.mysema.query.types.Predicate, org.springframework.data.domain.Sort)
*/
@@ -134,7 +134,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
return executeSorted(createQuery(predicate).select(path), sort);
}
/*
/*
* (non-Javadoc)
* @see org.springframework.data.querydsl.QuerydslPredicateExecutor#findAll(com.mysema.query.types.OrderSpecifier[])
*/
@@ -171,7 +171,7 @@ public class QuerydslJpaPredicateExecutor<T> implements QuerydslPredicateExecuto
return createQuery(predicate).fetchCount();
}
/*
/*
* (non-Javadoc)
* @see org.springframework.data.querydsl.QueryDslPredicateExecutor#exists(com.mysema.query.types.Predicate)
*/