/** * Applies sorting to the given {@link JPQLQuery}. * * @param sort * @param query must not be {@literal null}. * @return the Querydsl {@link JPQLQuery} */ public <T> JPQLQuery<T> applySorting(Sort sort, JPQLQuery<T> query) { if (sort.isUnsorted()) { return query; } if (sort instanceof QSort) { return addOrderByFrom((QSort) sort, query); } return addOrderByFrom(sort, query); }
/** * Applies sorting to the given {@link JPQLQuery}. * * @param sort * @param query must not be {@literal null}. * @return the Querydsl {@link JPQLQuery} */ public <T> JPQLQuery<T> applySorting(Sort sort, JPQLQuery<T> query) { if (sort.isUnsorted()) { return query; } if (sort instanceof QSort) { return addOrderByFrom((QSort) sort, query); } return addOrderByFrom(sort, query); }