本文整理了Java中org.molgenis.data.Query.getPageSize
方法的一些代码示例,展示了Query.getPageSize
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getPageSize
方法的具体详情如下:
包路径:org.molgenis.data.Query
类名称:Query
方法名:getPageSize
暂无
代码示例来源:origin: org.molgenis/molgenis-data-rest
if (q.getPageSize() == 0) {
q.pageSize(EntityCollectionRequest.DEFAULT_ROW_COUNT);
if (q.getPageSize() > EntityCollectionRequest.MAX_ROWS) {
resp.sendError(
HttpServletResponse.SC_BAD_REQUEST,
代码示例来源:origin: org.molgenis/molgenis-data-cache
/**
* Retrieves a {@link List} of identifiers from the {@link L3Cache} if the {@link Repository} is
* cacheable and the {@link Query} is limited (i.e. contains a pageSize) between 0 and
* MAX_PAGE_SIZE
*
* @param query The {@link Query}
* @return A stream of {@link Entity}
*/
@Override
public Stream<Entity> findAll(Query<Entity> query) {
if (transactionInformation.isRepositoryCompletelyClean(getEntityType())) {
// FIXME page size for metadata is always 0, and batching is done by the postgres repository
// FIXME Only superusers are able to use the L3 cache for metadata
if (cacheable && query.getPageSize() > 0 && query.getPageSize() <= MAX_PAGE_SIZE) {
List<Object> ids = l3Cache.get(delegate(), query);
return delegate().findAll(ids.stream(), query.getFetch());
}
} else {
LOG.debug("Repository is dirty: {}", getName());
}
return delegate().findAll(query);
}
代码示例来源:origin: org.molgenis/molgenis-data-postgresql
if (q.getPageSize() > 0) {
result.append(" LIMIT ").append(q.getPageSize());
代码示例来源:origin: org.molgenis/molgenis-data-rest
Long count = dataService.count(entityTypeId, new QueryImpl<>(q).setOffset(0).setPageSize(0));
Iterable<Entity> it;
if (count > 0 && q.getPageSize() > 0) {
it = () -> dataService.findAll(entityTypeId, q).iterator();
} else {
内容来源于网络,如有侵权,请联系作者删除!