Tabnine Logo
Pageable.isPaged
Code IndexAdd Tabnine to your IDE (free)

How to use
isPaged
method
in
org.springframework.data.domain.Pageable

Best Java code snippets using org.springframework.data.domain.Pageable.isPaged (Showing top 20 results out of 315)

origin: spring-projects/spring-data-jpa

/**
 * Creates a new {@link TypedQuery} from the given {@link Specification}.
 *
 * @param spec can be {@literal null}.
 * @param domainClass must not be {@literal null}.
 * @param pageable must not be {@literal null}.
 * @return
 */
protected <S extends T> TypedQuery<S> getQuery(@Nullable Specification<S> spec, Class<S> domainClass,
    Pageable pageable) {
  Sort sort = pageable.isPaged() ? pageable.getSort() : Sort.unsorted();
  return getQuery(spec, domainClass, sort);
}
origin: spring-projects/spring-data-mongodb

/**
 * Configures the {@link Pageable} to use.
 *
 * @param pageable must not be {@literal null}
 * @return
 */
public NearQuery with(Pageable pageable) {
  Assert.notNull(pageable, "Pageable must not be 'null'.");
  if (pageable.isPaged()) {
    this.num = pageable.getOffset() + pageable.getPageSize();
    this.skip = pageable.getOffset();
  }
  return this;
}
origin: spring-projects/spring-data-jpa

/**
 * Creates a new {@link TypedQuery} from the given {@link Specification}.
 *
 * @param spec can be {@literal null}.
 * @param pageable must not be {@literal null}.
 * @return
 */
protected TypedQuery<T> getQuery(@Nullable Specification<T> spec, Pageable pageable) {
  Sort sort = pageable.isPaged() ? pageable.getSort() : Sort.unsorted();
  return getQuery(spec, getDomainClass(), sort);
}
origin: spring-projects/spring-data-jpa

/**
 * Reads the given {@link TypedQuery} into a {@link Page} applying the given {@link Pageable} and
 * {@link Specification}.
 *
 * @param query must not be {@literal null}.
 * @param domainClass must not be {@literal null}.
 * @param spec can be {@literal null}.
 * @param pageable can be {@literal null}.
 * @return
 */
protected <S extends T> Page<S> readPage(TypedQuery<S> query, final Class<S> domainClass, Pageable pageable,
    @Nullable Specification<S> spec) {
  if (pageable.isPaged()) {
    query.setFirstResult((int) pageable.getOffset());
    query.setMaxResults(pageable.getPageSize());
  }
  return PageableExecutionUtils.getPage(query.getResultList(), pageable,
      () -> executeCountQuery(getCountQuery(spec, domainClass)));
}
origin: spring-projects/spring-data-elasticsearch

private SearchRequest prepareScroll(Query query, long scrollTimeInMillis) {
  SearchRequest request = new SearchRequest(toArray(query.getIndices()));
  SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
  request.types(toArray(query.getTypes()));
  request.scroll(TimeValue.timeValueMillis(scrollTimeInMillis));
  if (query.getPageable().isPaged()) {
    searchSourceBuilder.size(query.getPageable().getPageSize());
  }
  if (!isEmpty(query.getFields())) {
    searchSourceBuilder.fetchSource(toArray(query.getFields()), null);
  }
  request.source(searchSourceBuilder);
  return request;
}
origin: spring-projects/spring-data-elasticsearch

if (pageable.isPaged()) {
origin: spring-projects/spring-data-elasticsearch

if (query.getPageable().isPaged()) {
  startRecord = query.getPageable().getPageNumber() * query.getPageable().getPageSize();
  sourceBuilder.size(query.getPageable().getPageSize());
origin: org.springframework.data/spring-data-mongodb

/**
 * Configures the {@link Pageable} to use.
 *
 * @param pageable must not be {@literal null}
 * @return
 */
public NearQuery with(Pageable pageable) {
  Assert.notNull(pageable, "Pageable must not be 'null'.");
  if (pageable.isPaged()) {
    this.num = pageable.getOffset() + pageable.getPageSize();
    this.skip = pageable.getOffset();
  }
  return this;
}
origin: spring-projects/spring-data-neo4j

public String getCypherQuery(Pageable pageable, boolean forSlicing) {
  String result = cypherQuery;
  Sort sort = null;
  if (pageable.isPaged() && pageable.getSort() != Sort.unsorted()) {
    sort = pageable.getSort();
  }
  if (sort != Sort.unsorted()) {
    // Custom queries in the OGM do not support pageable
    result = addSorting(result, sort);
  }
  result = addPaging(result, pageable, forSlicing);
  return result;
}
origin: apache/servicemix-bundles

/**
 * Returns whether the current {@link Pageable} does not contain pagination information.
 *
 * @return
 */
default boolean isUnpaged() {
  return !isPaged();
}
origin: Blazebit/blaze-persistence

@Override
protected int getLimit(Pageable pageable) {
  if (pageable.isPaged()) {
    return pageable.getPageSize();
  }
  return Integer.MAX_VALUE;
}
origin: com.blazebit/blaze-persistence-integration-spring-data-2.0

@Override
protected int getLimit(Pageable pageable) {
  if (pageable.isPaged()) {
    return pageable.getPageSize();
  }
  return Integer.MAX_VALUE;
}
origin: Blazebit/blaze-persistence

@Override
protected int getOffset(Pageable pageable) {
  if (pageable.isPaged()) {
    return (int) pageable.getOffset();
  }
  return 0;
}
origin: com.blazebit/blaze-persistence-integration-spring-data-2.0

@Override
protected int getOffset(Pageable pageable) {
  if (pageable.isPaged()) {
    return (int) pageable.getOffset();
  }
  return 0;
}
origin: com.blazebit/blaze-persistence-integration-spring-data-2.1

@Override
protected int getLimit(Pageable pageable) {
  if (pageable.isPaged()) {
    return pageable.getPageSize();
  }
  return Integer.MAX_VALUE;
}
origin: org.springframework.data/spring-data-jpa

/**
 * Creates a new {@link TypedQuery} from the given {@link Specification}.
 *
 * @param spec can be {@literal null}.
 * @param domainClass must not be {@literal null}.
 * @param pageable must not be {@literal null}.
 * @return
 */
protected <S extends T> TypedQuery<S> getQuery(@Nullable Specification<S> spec, Class<S> domainClass,
    Pageable pageable) {
  Sort sort = pageable.isPaged() ? pageable.getSort() : Sort.unsorted();
  return getQuery(spec, domainClass, sort);
}
origin: org.springframework.data/spring-data-jpa

/**
 * Creates a new {@link TypedQuery} from the given {@link Specification}.
 *
 * @param spec can be {@literal null}.
 * @param pageable must not be {@literal null}.
 * @return
 */
protected TypedQuery<T> getQuery(@Nullable Specification<T> spec, Pageable pageable) {
  Sort sort = pageable.isPaged() ? pageable.getSort() : Sort.unsorted();
  return getQuery(spec, getDomainClass(), sort);
}
origin: alibaba/sca-best-practice

protected <T> Page<T> readPage(final Class<T> clazz, TypedQuery<T> query, Pageable pageable,
                @Nullable Specification<T> spec) {
  if (pageable.isPaged()) {
    query.setFirstResult((int)pageable.getOffset());
    query.setMaxResults(pageable.getPageSize());
  }
  return PageableExecutionUtils.getPage(query.getResultList(), pageable,
    () -> executeCountQuery(getCountQuery(clazz, spec)));
}
origin: org.springframework.data/spring-data-keyvalue

@Override
public Page<T> findAll(Predicate predicate, Pageable pageable) {
  AbstractCollQuery<T, ?> query = prepareQuery(predicate);
  if (pageable.isPaged() || pageable.getSort().isSorted()) {
    query.offset(pageable.getOffset());
    query.limit(pageable.getPageSize());
    if (pageable.getSort().isSorted()) {
      query.orderBy(toOrderSpecifier(pageable.getSort(), builder));
    }
  }
  return new PageImpl<>(query.fetchResults().getResults(), pageable, count(predicate));
}
origin: spring-projects/spring-data-keyvalue

@Override
public Page<T> findAll(Predicate predicate, Pageable pageable) {
  AbstractCollQuery<T, ?> query = prepareQuery(predicate);
  if (pageable.isPaged() || pageable.getSort().isSorted()) {
    query.offset(pageable.getOffset());
    query.limit(pageable.getPageSize());
    if (pageable.getSort().isSorted()) {
      query.orderBy(toOrderSpecifier(pageable.getSort(), builder));
    }
  }
  return new PageImpl<>(query.fetchResults().getResults(), pageable, count(predicate));
}
org.springframework.data.domainPageableisPaged

Javadoc

Returns whether the current Pageable contains pagination information.

Popular methods of Pageable

  • getPageSize
    Returns the number of items to be returned.
  • getSort
    Returns the sorting parameters.
  • getOffset
  • getPageNumber
    Returns the page to be returned.
  • unpaged
  • isUnpaged
  • previousOrFirst
  • toOptional
  • hasPrevious
  • next
  • first
  • getSortOr
    Returns the current Sort or the given one if the current one is unsorted.
  • first,
  • getSortOr

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • putExtra (Intent)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Runner (org.openjdk.jmh.runner)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now