com.psddev.dari.db.Query.sortDescending()方法的使用及代码示例

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

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

Query.sortDescending介绍

[英]Adds a sorter that prioritizes the larger values associated with the given key.
[中]添加一个排序器,对与给定键关联的较大值进行优先级排序。

代码示例

代码示例来源:origin: perfectsense/brightspot-cms

public static Query<ToolUserSearch> createQuery(ToolUser user, String recentName) {
  return Query.from(ToolUserSearch.class)
      .where("key startsWith ?", user.getId().toString() + recentName)
      .sortDescending("key");
}

代码示例来源:origin: perfectsense/brightspot-cms

/**
 * Finds the last action from this device.
 *
 * @return May be {@code null}.
 */
public ToolUserAction findLastAction() {
  return Query
      .from(ToolUserAction.class)
      .where("device = ?", this)
      .sortDescending("time")
      .first();
}

代码示例来源: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/brightspot-cms

.from(ToolUserAction.class)
.where("device = ?", this)
.sortDescending("time")
.selectAll();

代码示例来源:origin: perfectsense/brightspot-cms

public Query<?> toQuery() {
  State state = getState();
  Query<?> query = Query.fromType(getQueryType());
  Predicate predicate = query.getPredicate();
  for (ObjectField field : getIndexedFields()) {
    String name = field.getInternalName();
    Object value = state.get(FIELD_PREFIX + name);
    if (!ObjectUtils.isBlank(value)) {
      String type = field.getInternalItemType();
      String operator = (String) state.get(OPERATOR_PREFIX + name);
      if (operator == null) {
        operator = ObjectField.REFERENTIAL_TEXT_TYPE.equals(type) || ObjectField.TEXT_TYPE.equals(type) ? "matchesAll" : "equalsAny";
      }
      predicate = CompoundPredicate.combine(
          PredicateParser.AND_OPERATOR,
          predicate,
          PredicateParser.Static.parse(name + " " + operator + " ?", value));
    }
  }
  query.setPredicate(predicate);
  ObjectField sortField = getSortField();
  if (ObjectField.DATE_TYPE.equals(sortField.getInternalItemType())) {
    query.sortDescending(sortField.getInternalName());
  } else {
    query.sortAscending(sortField.getInternalName());
  }
  return query;
}

代码示例来源:origin: perfectsense/brightspot-cms

query.sortDescending(sortName);
query.sortDescending(originFieldName);
        .sortDescending("key")
        .select(5, 1)
        .getItems();

代码示例来源:origin: perfectsense/brightspot-cms

.from(ToolUserAction.class)
.where("device = ?", d)
.sortDescending("time")
.selectAll();

代码示例来源:origin: perfectsense/dari

query.sortDescending(sortField);
} else {
  query.sortAscending(sortField);

代码示例来源:origin: perfectsense/brightspot-cms

Object maxObject = search.toQuery(page.getSite()).sortDescending(sortFieldName).first();
maxSum = maxObject != null
    ? ((Metric) State.getInstance(maxObject).get(sortFieldName)).getSum()

代码示例来源:origin: perfectsense/brightspot-cms

.from(ToolUserAction.class)
.where("device = ?", d)
.sortDescending("time")
.selectAll();

代码示例来源:origin: perfectsense/brightspot-cms

.where("owner = ?", user)
.and("updateDate != missing")
.sortDescending("updateDate")
.select(50, 1)
.getItems();

代码示例来源:origin: perfectsense/brightspot-cms

.from(ToolUserAction.class)
.where("device = ?", device)
.sortDescending("time")
.noCache()
.first();
    .from(ToolUserAction.class)
    .where("device = ?", device)
    .sortDescending("time")
    .noCache()
    .first();

代码示例来源:origin: perfectsense/brightspot-cms

.and("_type != ?", Draft.class)
    .and("_id != ?", id)
    .sortDescending("cms.content.updateDate");
PaginatedResult<Object> result = query.select(0L, 10);

代码示例来源:origin: perfectsense/brightspot-cms

Object maxObject = search.toQuery(page.getSite()).sortDescending(sortFieldName).first();
maxSum = maxObject != null
    ? ((Metric) State.getInstance(maxObject).get(sortFieldName)).getSum()

代码示例来源:origin: perfectsense/brightspot-cms

.and(Content.UPDATE_DATE_FIELD + " != missing")
.and(page.siteItemsPredicate())
.sortDescending(Content.UPDATE_DATE_FIELD)
.selectFiltered(page.param(long.class, "offset"), limit, queryFilter);

代码示例来源:origin: perfectsense/brightspot-cms

.from(History.class)
.where("name = missing and objectId = ?", state.getId())
.sortDescending("updateDate")
.select(0, 10);
.from(History.class)
.where("name = missing and getObjectIdUpdateDate ^= ?", state.getId().toString())
.sortDescending("getObjectIdUpdateDate")
.select(0, 10);

代码示例来源:origin: perfectsense/brightspot-cms

.where(page.siteItemsSearchPredicate())
.and(Content.UPDATE_DATE_FIELD + " != missing")
.sortDescending(Content.UPDATE_DATE_FIELD);

代码示例来源:origin: perfectsense/brightspot-cms

.from(Object.class)
.where("cms.content.trashed = true")
.sortDescending("cms.content.updateDate")
.select(page.param(long.class, "offset"), page.paramOrDefault(int.class, "limit", 10));

代码示例来源:origin: perfectsense/brightspot-cms

.from(WorkflowLog.class)
.where("objectId = ?", page.param(UUID.class, "objectId"))
.sortDescending("date")
.selectAll();

代码示例来源:origin: perfectsense/brightspot-cms

.where("owner = ?", page.getUser())
.and("updateDate != missing")
.sortDescending("updateDate");

相关文章