DATACMNS-402 - Slight refinements in QSort implementation.

Re-enable concatenation with plain Sort via ….and(…) method. Some general polishing and JavaDoc cleanups.

Original pull request: #59.
This commit is contained in:
Oliver Gierke
2013-12-04 13:30:19 +01:00
parent f2ff84fb63
commit 62e14d2b12
3 changed files with 44 additions and 31 deletions

View File

@@ -86,7 +86,7 @@ public class QSort extends Sort implements Serializable {
Assert.notNull(orderSpecifier, "Order specifier must not be null!");
Expression<?> target = orderSpecifier.getTarget();
Object targetElement = ((com.mysema.query.types.Path) target).getMetadata().getElement();
Object targetElement = ((com.mysema.query.types.Path<?>) target).getMetadata().getElement();
Assert.notNull(targetElement, "Target element must not be null!");
@@ -100,15 +100,6 @@ public class QSort extends Sort implements Serializable {
return orderSpecifiers;
}
/*
* (non-Javadoc)
* @see org.springframework.data.domain.Sort#and(org.springframework.data.domain.Sort)
*/
@Override
public Sort and(Sort sort) {
throw new UnsupportedOperationException("You cannot combine a querydsl based QSort with an arbitrary Sort!");
}
/**
* Returns a new {@link QSort} consisting of the {@link OrderSpecifier}s of the current {@code QSort} combined with
* the ones from the given {@code QSort}.
@@ -147,7 +138,6 @@ public class QSort extends Sort implements Serializable {
public QSort and(OrderSpecifier<?>... orderSpecifiers) {
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty!");
return and(Arrays.asList(orderSpecifiers));
}
}