io.ebean.Query.setMaxRows()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中io.ebean.Query.setMaxRows方法的一些代码示例,展示了Query.setMaxRows的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setMaxRows方法的具体详情如下:
包路径:io.ebean.Query
类名称:Query
方法名:setMaxRows

Query.setMaxRows介绍

[英]Set the maximum number of rows to return in the query.
[中]设置查询中要返回的最大行数。

代码示例

代码示例来源:origin: ebean-orm/ebean

@Override
public Query<T> setMaxRows(int maxRows) {
 return query.setMaxRows(maxRows);
}

代码示例来源:origin: ebean-orm/ebean

@Override
public Query<T> setMaxRows(int maxRows) {
 return rootQuery.setMaxRows(maxRows);
}

代码示例来源:origin: org.actframework/act-ebean

@Override
public EbeanQuery<MODEL_TYPE> limit(int limit) {
  q.setMaxRows(limit);
  qReadOnly.setMaxRows(limit);
  return this;
}

代码示例来源:origin: org.actframework/act-ebean

@Override
public EbeanQuery<MODEL_TYPE> setMaxRows(int maxRows) {
  q.setMaxRows(maxRows);
  qReadOnly.setMaxRows(maxRows);
  return this;
}

代码示例来源:origin: org.actframework/act-ebean2

@Override
public EbeanQuery<MODEL_TYPE> setMaxRows(int maxRows) {
  q.setMaxRows(maxRows);
  return this;
}

代码示例来源:origin: io.ebean/ebean

@Override
public Query<T> setMaxRows(int maxRows) {
 return query.setMaxRows(maxRows);
}

代码示例来源:origin: org.actframework/act-ebean2

@Override
public EbeanQuery<MODEL_TYPE> limit(int limit) {
  q.setMaxRows(limit);
  return this;
}

代码示例来源:origin: io.ebean/ebean-querybean

/**
 * Set the maximum number of rows to return in the query.
 *
 * @param maxRows the maximum number of rows to return in the query.
 */
public R setMaxRows(int maxRows) {
 query.setMaxRows(maxRows);
 return root;
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

void setMaxRows(int maxRows) {
  if (queryType == QUERY) {
    ((Query) queryInstance).setMaxRows(maxRows);
    return;
  }
  throw new IllegalArgumentException("query not supported!");
}

代码示例来源:origin: hexagonframework/spring-data-ebean

void setMaxRows(int maxRows) {
  if (queryType == QUERY) {
    ((Query) queryInstance).setMaxRows(maxRows);
    return;
  }
  throw new IllegalArgumentException("query not supported!");
}

代码示例来源:origin: icode/ameba

/**
 * {@inheritDoc}
 * Sets the maximum number of rows to return in the query.
 */
public Query<T> setMaxRows(int maxRows) {
  return query().setMaxRows(maxRows);
}

代码示例来源:origin: org.actframework/act-ebean

@Override
public MODEL_TYPE first() {
  List<MODEL_TYPE> list = qReadOnly.setMaxRows(1).findList();
  return list.isEmpty() ? null : list.get(0);
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

@SuppressWarnings("unchecked")
<E> Slice<E> findSlice(Pageable pageable) {
  List<E> resultList = null;
  int pageSize = pageable.getPageSize();
  int offset = (int) pageable.getOffset();
  if (queryType == QUERY) {
    resultList = ((Query<E>) queryInstance).setFirstRow(offset).setMaxRows(pageSize + 1).findList();
    boolean hasNext = resultList.size() > pageSize;
    return new SliceImpl<E>(hasNext ? resultList.subList(0, pageSize) : resultList, pageable, hasNext);
  }
  throw new IllegalArgumentException("query not supported!");
}

代码示例来源:origin: hexagonframework/spring-data-ebean

@SuppressWarnings("unchecked")
<E> Page<E> findPage(Pageable pageable) {
  if (queryType == QUERY) {
    PagedList<E> pagedList = ((Query<E>) queryInstance)
        .setFirstRow((int) pageable.getOffset())
        .setMaxRows(pageable.getPageSize())
        .findPagedList();
    return PageableExecutionUtils.getPage(pagedList.getList(), pageable, pagedList::getTotalCount);
  }
  throw new IllegalArgumentException("query not supported!");
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

@SuppressWarnings("unchecked")
<E> Page<E> findPage(Pageable pageable) {
  if (queryType == QUERY) {
    PagedList<E> pagedList = ((Query<E>) queryInstance)
        .setFirstRow((int) pageable.getOffset())
        .setMaxRows(pageable.getPageSize())
        .findPagedList();
    return PageableExecutionUtils.getPage(pagedList.getList(), pageable, pagedList::getTotalCount);
  }
  throw new IllegalArgumentException("query not supported!");
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

@Override
public <S extends T> Page<S> findAll(String fetchPath, Example<S> example, Pageable pageable) {
  PagedList<S> pagedList = queryByExample(fetchPath, example)
      .setMaxRows(pageable.getPageSize())
      .setFirstRow((int) pageable.getOffset())
      .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
      .findPagedList();
  return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}

代码示例来源:origin: hexagonframework/spring-data-ebean

@Override
public <S extends T> Page<S> findAll(String fetchPath, Example<S> example, Pageable pageable) {
  PagedList<S> pagedList = queryByExample(fetchPath, example)
      .setMaxRows(pageable.getPageSize())
      .setFirstRow((int) pageable.getOffset())
      .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
      .findPagedList();
  return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

@Override
public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable) {
  PagedList<S> pagedList = queryByExample(example)
      .setMaxRows(pageable.getPageSize())
      .setFirstRow((int) pageable.getOffset())
      .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
      .findPagedList();
  return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

@Override
public Page<T> findAll(String fetchPath, Pageable pageable) {
  PagedList<T> pagedList = query(fetchPath)
      .setMaxRows(pageable.getPageSize())
      .setFirstRow((int) pageable.getOffset())
      .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
      .findPagedList();
  return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}

代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean

@Override
public Page<T> findAll(Pageable pageable) {
  PagedList<T> pagedList = db().find(getEntityType())
      .setMaxRows(pageable.getPageSize())
      .setFirstRow((int) pageable.getOffset())
      .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
      .findPagedList();
  return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}

相关文章

Query类方法