/** * Executes the given {@link JPQLQuery} after applying the given {@link Sort}. * * @param query must not be {@literal null}. * @param sort must not be {@literal null}. * @return */ private List<T> executeSorted(JPQLQuery<T> query, Sort sort) { return querydsl.applySorting(sort, query).fetch(); } }
/** * Executes the given {@link JPQLQuery} after applying the given {@link Sort}. * * @param query must not be {@literal null}. * @param sort must not be {@literal null}. * @return */ private List<T> executeSorted(JPQLQuery<T> query, Sort sort) { return querydsl.applySorting(sort, query).fetch(); } }
/** * Applies the given {@link Pageable} to the given {@link JPQLQuery}. * * @param pageable * @param query must not be {@literal null}. * @return the Querydsl {@link JPQLQuery}. */ public <T> JPQLQuery<T> applyPagination(Pageable pageable, JPQLQuery<T> query) { if (pageable.isUnpaged()) { return query; } query.offset(pageable.getOffset()); query.limit(pageable.getPageSize()); return applySorting(pageable.getSort(), query); }
/** * Executes the given {@link JPQLQuery} after applying the given {@link Sort}. * * @param query must not be {@literal null}. * @param sort must not be {@literal null}. * @return */ private List<T> executeSorted(JPQLQuery<T> query, Sort sort) { return querydsl.applySorting(sort, query).fetch(); } }
/** * Executes the given {@link JPQLQuery} after applying the given {@link Sort}. * * @param query must not be {@literal null}. * @param sort must not be {@literal null}. * @return */ private List<T> executeSorted(JPQLQuery<T> query, Sort sort) { return querydsl.applySorting(sort, query).fetch(); } }
@Deprecated protected void onCreateSort(JPQLQuery<?> query) { Class<T> domainClass = getDomainClass(); if (ClassUtils.isAssignable(DataEntity.class, domainClass)) { Sort createdDateDesc = new Sort(Direction.DESC, "createdDate"); query = querydsl.applySorting(createdDateDesc, query); } if (ClassUtils.isAssignable(SortEntity.class, domainClass)) { Sort sortNoAsc = new Sort("sortNo"); query = querydsl.applySorting(sortNoAsc, query); } }
/** * Applies the given {@link Pageable} to the given {@link JPQLQuery}. * * @param pageable * @param query must not be {@literal null}. * @return the Querydsl {@link JPQLQuery}. */ public <T> JPQLQuery<T> applyPagination(Pageable pageable, JPQLQuery<T> query) { if (pageable.isUnpaged()) { return query; } query.offset(pageable.getOffset()); query.limit(pageable.getPageSize()); return applySorting(pageable.getSort(), query); }