congrats Icon
New! Announcing our next generation AI code completions
Read here
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

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • getContentResolver (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BoxLayout (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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