本文整理了Java中com.psddev.dari.db.Query.select
方法的一些代码示例,展示了Query.select
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.select
方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:select
暂无
代码示例来源:origin: perfectsense/brightspot-cms
@Override
public List<?> findContents(int offset, int limit) {
return getQuery().select(offset, limit).getItems();
}
}
代码示例来源:origin: perfectsense/dari
return select(offset, limit);
代码示例来源:origin: perfectsense/dari
@Override
public boolean hasNext() {
if (result != null && index >= result.getItems().size()) {
if (result.hasNext()) {
result = null;
} else {
return false;
}
}
if (result == null) {
result = query.select(offset, limit);
List<T> items = result.getItems();
int size = items.size();
if (size < 1) {
return false;
}
offset += limit;
index = 0;
}
return true;
}
代码示例来源:origin: perfectsense/brightspot-cms
/** @deprecated Use {@link #toQuery} instead. */
@Deprecated
public PaginatedResult<?> getResult() {
if (result == null) {
result = toQuery(page != null ? page.getSite() : null).select(getOffset(), getLimit());
}
return result;
}
}
代码示例来源:origin: perfectsense/brightspot-cms
/**
* Optionally override for more control over the creation of
* the {@link PaginatedResult}.
*
* @param page Used for access to request parameters.
* @return the {@link PaginatedResult} to be displayed by the widget.
*/
public PaginatedResult<T> getPaginatedResult(ToolPageContext page) {
return getQuery(page).select(page.param(long.class, OFFSET_PARAMETER), page.paramOrDefault(int.class, LIMIT_PARAMETER, LIMITS[0]));
}
代码示例来源:origin: perfectsense/brightspot-cms
/**
* Returns a partial list of all the revisions of the object with the
* given {@code objectId} within the given {@code offset} and
* {@code limit}.
*/
public static PaginatedResult<History> findByObjectId(ToolUser user, UUID objectId, long offset, int limit) {
return Query
.from(History.class)
.where("objectId = ?", objectId)
.sortDescending("updateDate")
.select(offset, limit);
}
代码示例来源:origin: perfectsense/dari
items = nextQuery.select(0, fetchSize).getItems();
items = nextQuery.select(0, fetchSize).getItems();
size = items.size();
代码示例来源:origin: perfectsense/dari
items = nextQuery.select(0, fetchSize).getItems();
int size = items.size();
items = nextQuery.select(0, fetchSize).getItems();
size = items.size();
代码示例来源:origin: perfectsense/dari
@Override
public List<E> getItems() {
if (items == null) {
items = new ArrayList<E>();
long start = getOffset();
long end = start + getLimit();
long current = 0;
for (int i = 0;; ++ i) {
Long count = getCountFor(i);
if (count == null) {
break;
}
long next = current + count;
if (current < end && next > start) {
items.addAll(getQueryFor(i).select(
start <= current ? 0L : (start - current),
(int) (end - current)).getItems());
if (next >= end) {
break;
}
}
current = next;
}
}
return items;
}
代码示例来源:origin: perfectsense/dari
renderAtomFeed(context, query.select(
context.param(long.class, "$skip"),
context.paramOrDefault(int.class, "$top", 10)));
代码示例来源:origin: perfectsense/dari
@Override
public boolean hasNext() {
if (result != null && index >= result.getItems().size()) {
if (result.hasNext()) {
result = null;
} else {
return false;
}
}
if (result == null) {
Query<T> nextQuery = query.clone();
if (lastObjectId != null) {
nextQuery.and("_id > ?", lastObjectId);
}
result = nextQuery.select(0, fetchSize);
List<T> items = result.getItems();
int size = items.size();
if (size < 1) {
return false;
}
lastObjectId = State.getInstance(items.get(size - 1)).getId();
index = 0;
}
return true;
}
代码示例来源:origin: perfectsense/brightspot-cms
.where("lastPing < ?", Database.Static.getDefault().now() - 60L * 1000L);
for (List<RtcSession> sessions; !(sessions = query.select(0, 100).getItems()).isEmpty();) {
sessions.forEach(RtcSession::disconnect);
代码示例来源:origin: perfectsense/dari
private PaginatedResult<Map<String, Object>> readPartial(Database database, WebPageContext context) {
long offset = context.param(long.class, WebDatabase.OFFSET_PARAMETER);
int limit = context.paramOrDefault(int.class, WebDatabase.LIMIT_PARAMETER, 10);
PaginatedResult<?> result = createQuery(database, context).select(offset, limit);
List<Map<String, Object>> itemMaps = new ArrayList<Map<String, Object>>();
for (Object item : result.getItems()) {
itemMaps.add(State.getInstance(item).getSimpleValues());
}
return new PaginatedResult<Map<String, Object>>(
result.getOffset(),
result.getLimit(),
result.getCount(),
itemMaps);
}
代码示例来源:origin: perfectsense/brightspot-cms
private PaginatedResult<WorkStream> getResults(ToolPageContext page) {
Query<WorkStream> query = Query.from(WorkStream.class).where(page.siteItemsPredicate());
ToolEntityType entityType = page.pageParam(ToolEntityType.class, TOOL_ENTITY_TYPE_PARAMETER, ToolEntityType.ANYONE);
UUID entityId = null;
if (entityType == ToolEntityType.USER || entityType == ToolEntityType.ROLE) {
entityId = page.pageParam(UUID.class, TOOL_ENTITY_VALUE_PARAMETER, null);
} else if (entityType == ToolEntityType.ME) {
entityId = page.getUser().getId();
}
if (entityId != null) {
query.and("assignedEntities = ?", entityId);
}
return query.select(page.param(long.class, OFFSET_PARAMETER), page.paramOrDefault(int.class, LIMIT_PARAMETER, LIMITS[0]));
}
代码示例来源:origin: perfectsense/brightspot-cms
result = search.toQuery(page.getSite()).select(search.getOffset(), search.getLimit());
代码示例来源:origin: perfectsense/brightspot-cms
result = search.toQuery(page.getSite()).select(search.getOffset(), search.getLimit());
代码示例来源:origin: perfectsense/brightspot-cms
result = search.toQuery(page.getSite()).select(search.getOffset(), search.getLimit());
代码示例来源:origin: perfectsense/brightspot-cms
PaginatedResult<?> result = searchQuery.select(search.getOffset(), search.getLimit());
代码示例来源:origin: perfectsense/brightspot-cms
.and("_id != ?", id)
.sortDescending("cms.content.updateDate");
PaginatedResult<Object> result = query.select(0L, 10);
代码示例来源:origin: perfectsense/brightspot-cms
.where("cms.content.trashed = true")
.sortDescending("cms.content.updateDate")
.select(page.param(long.class, "offset"), page.paramOrDefault(int.class, "limit", 10));
内容来源于网络,如有侵权,请联系作者删除!