Example usage for org.springframework.data.domain Pageable getSort

List of usage examples for org.springframework.data.domain Pageable getSort

Introduction

In this page you can find the example usage for org.springframework.data.domain Pageable getSort.

Prototype

Sort getSort();

Source Link

Document

Returns the sorting parameters.

Usage

From source file:org.springframework.data.elasticsearch.core.query.AbstractQuery.java

@Override
public final <T extends Query> T setPageable(Pageable pageable) {
    Assert.notNull(pageable);/*ww w. j a  va 2s  .c om*/
    this.pageable = pageable;
    return (T) this.addSort(pageable.getSort());
}

From source file:org.springframework.data.jpa.repository.support.SimpleJpaRepository.java

/**
 * Creates a new {@link TypedQuery} from the given {@link Specification}.
 * //  ww w.j  a v a2 s  . c om
 * @param spec can be {@literal null}.
 * @param pageable can be {@literal null}.
 * @return
 */
protected TypedQuery<T> getQuery(Specification<T> spec, Pageable pageable) {

    Sort sort = pageable == null ? null : pageable.getSort();
    return getQuery(spec, sort);
}