本文整理了Java中org.springframework.data.jpa.repository.support.Querydsl.applySorting
方法的一些代码示例,展示了Querydsl.applySorting
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Querydsl.applySorting
方法的具体详情如下:
包路径:org.springframework.data.jpa.repository.support.Querydsl
类名称:Querydsl
方法名:applySorting
[英]Applies sorting to the given JPQLQuery.
[中]将排序应用于给定的JPQLQuery。
代码示例来源:origin: spring-projects/spring-data-jpa
/**
* 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();
}
}
代码示例来源:origin: spring-projects/spring-data-jpa
/**
* 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();
}
}
代码示例来源:origin: spring-projects/spring-data-jpa
/**
* 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);
}
代码示例来源:origin: org.springframework.data/spring-data-jpa
/**
* 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();
}
}
代码示例来源:origin: org.springframework.data/spring-data-jpa
/**
* 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();
}
}
代码示例来源:origin: com.airlenet/play-repo-jpa
@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);
}
}
代码示例来源:origin: org.springframework.data/spring-data-jpa
/**
* 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);
}
内容来源于网络,如有侵权,请联系作者删除!