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

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

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

Query.setFirstRow介绍

[英]Set the first row to return for this query.
[中]设置此查询要返回的第一行。

代码示例

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

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

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

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

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

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

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

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

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

@Override
public EbeanQuery<MODEL_TYPE> offset(int pos) {
  q.setFirstRow(pos);
  return this;
}

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

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

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

@Override
public EbeanQuery<MODEL_TYPE> offset(int pos) {
  q.setFirstRow(pos);
  qReadOnly.setFirstRow(pos);
  return this;
}

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

/**
 * Set the first row to return for this query.
 *
 * @param firstRow the first row to include in the query result.
 */
public R setFirstRow(int firstRow) {
 query.setFirstRow(firstRow);
 return root;
}

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

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

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

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

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

/**
 * {@inheritDoc}
 * Sets the first row to return for this query.
 */
public Query<T> setFirstRow(int firstRow) {
  return query().setFirstRow(firstRow);
}

代码示例来源: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> 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 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 <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(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类方法