org.jooq.TableField.desc()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(158)

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

TableField.desc介绍

暂无

代码示例

代码示例来源:origin: k55k32/cms-admin-end

@Override
  public PageResult<EmailSend> page(PageResult<EmailSend> page) {
    return dao.fetch(page, Tables.C_EMAIL_SEND.CREATE_TIME.desc());
  }
}

代码示例来源:origin: k55k32/cms-admin-end

public List<Comment> list(String articleId, Integer state, Optional<Long> lastTime) {
  List<Condition> conditions = new ArrayList<>();
  conditions.add(comment.ARTICLE_ID.eq(articleId));
  conditions.add(comment.STATE.eq(state));
  lastTime.ifPresent(time -> {
    conditions.add(comment.CREATE_TIME.gt(new Timestamp(time)));
  });
  return dao.fetch(conditions.stream(), comment.CREATE_TIME.desc());
}

代码示例来源:origin: k55k32/cms-admin-end

public PageResult<PageView> page(PageResult<PageView> page, Long start, Long end) {
  page = dao.fetch(page,getCondition(start, end), C_PAGE_VIEW.CREATE_TIME.desc());
  return page;
}

代码示例来源:origin: k55k32/cms-admin-end

public PageResult<Comment> page(PageResult<Comment> page, Optional<Integer> state, Optional<String> articleId) {
  List<Condition> conditions = new ArrayList<>();
  state.ifPresent(s ->{
    conditions.add(comment.STATE.eq(s));
  });
  articleId.ifPresent(a ->{
    conditions.add(comment.ARTICLE_ID.eq(a));
  });
  return dao.fetch(page, e -> {
    return e.select(Fields.all(comment.fields(), article.TITLE.as("articleTitle")))
    .from(comment)
    .leftJoin(article).on(comment.ARTICLE_ID.eq(article.ID))
    .where(conditions).orderBy(comment.CREATE_TIME.desc());
  }, Comment.class);
}

代码示例来源:origin: k55k32/cms-admin-end

private PageResult<Article> searchPageByCondition(PageResult<Article> page, Stream<Condition> cond) {
  page = dao.fetch(page, e -> {
    return e.select(Fields.all(C_ARTICLE.fields(),C_CATALOG.NAME.as("catalogName")))
    .from(C_ARTICLE)
    .leftJoin(C_CATALOG).on(C_ARTICLE.CATALOG_ID.eq(C_CATALOG.ID))
    .where(cond.collect(Collectors.toList()))
    .orderBy(C_ARTICLE.CREATE_TIME.desc());
  }, Article.class);
  List<Article> articles = page.getData();
  if (!articles.isEmpty()) {
    Map<String,Article> articlesMap = articles.stream().collect(Collectors.toMap(Article::getId, a -> {
      a.setTags(new ArrayList<>());
      return a;
    }));
    List<ArticleTag> articleTags = articleTagService.findTags(articlesMap.keySet());
    articleTags.forEach(articleTag -> {
      articlesMap.get(articleTag.getArticleId()).getTags().add(articleTag.getTag());
    });
  }
  return page;
}

代码示例来源:origin: com.gitee.hengboy/micro-job-common

/**
 * 根据节点地址查询节点信息
 *
 * @param nodeAddress 节点地址
 */
public JobNodeInfoRecord selectByAddress(String nodeAddress) {
  return dslContext
      .selectFrom(JOB_NODE_INFO)
      .where(JobNodeInfo.JNI_ADDRESS.eq(nodeAddress))
      .orderBy(JobNodeInfo.JNI_CREATE_TIME.desc())
      .limit(1)
      .fetchOne();
}

代码示例来源:origin: io.zipkin.java/storage-jdbc

dsl.and(keyToTables.get(entry.getKey()).A_VALUE.eq(entry.getValue().getBytes(UTF_8)));
return dsl.orderBy(ZIPKIN_SPANS.START_TS.desc()).limit(request.limit);

代码示例来源:origin: io.zipkin.java/spanstore-jdbc

dsl.and(keyToTables.get(entry.getKey()).A_VALUE.eq(entry.getValue().getBytes(UTF_8)));
return dsl.orderBy(ZIPKIN_SPANS.START_TS.desc()).limit(request.limit);

代码示例来源:origin: com.walmartlabs.concord.server/concord-server

public List<ProcessEntry> list(UUID parentInstanceId, Set<String> tags) {
  try (DSLContext tx = DSL.using(cfg)) {
    SelectQuery<Record> query = buildSelect(tx, DEFAULT_INCLUDES);
    query.addConditions(PROCESS_QUEUE.PARENT_INSTANCE_ID.eq(parentInstanceId));
    filterByTags(query, tags);
    query.addOrderBy(PROCESS_QUEUE.CREATED_AT.desc());
    return query.fetch(this::toEntry);
  }
}

代码示例来源:origin: io.zipkin.java/zipkin-storage-jdbc

dsl.and(keyToTables.get(entry.getKey()).A_VALUE.eq(entry.getValue().getBytes(UTF_8)));
return dsl.orderBy(ZIPKIN_SPANS.START_TS.desc()).limit(request.limit);

代码示例来源:origin: rancher/cattle

@Override
public AuthToken getTokenByAccountId(long accountId) {
  return create()
      .selectFrom(AUTH_TOKEN)
      .where(AUTH_TOKEN.ACCOUNT_ID.eq(accountId))
          .and(AUTH_TOKEN.VERSION.eq(SecurityConstants.TOKEN_VERSION))
          .and(AUTH_TOKEN.PROVIDER.eq(SecurityConstants.AUTH_PROVIDER.get()))
          .and(AUTH_TOKEN.EXPIRES.greaterThan(new Date()))
      .orderBy(AUTH_TOKEN.EXPIRES.desc()).fetchAny();
}

代码示例来源:origin: com.walmartlabs.concord.server/concord-server

public UUID getRecentId(UUID instanceId, String checkpointName) {
  return txResult(tx -> tx.select(PROCESS_CHECKPOINTS.CHECKPOINT_ID)
      .from(PROCESS_CHECKPOINTS)
      .where(PROCESS_CHECKPOINTS.INSTANCE_ID.eq(instanceId).and(PROCESS_CHECKPOINTS.CHECKPOINT_NAME.eq(checkpointName)))
      .orderBy(PROCESS_CHECKPOINTS.CHECKPOINT_DATE.desc())
      .limit(1)
      .fetchOne(PROCESS_CHECKPOINTS.CHECKPOINT_ID));
}

代码示例来源:origin: rancher/cattle

query.addOrderBy(sortField.desc());
    break;
  default:
switch (sort.getOrderEnum()) {
  case DESC:
    query.addOrderBy(idSort.desc());
    break;
  default:

代码示例来源:origin: rancher/cattle

.and(accountsToIgnore.size() == 0 ? DSL.trueCondition()
        : SCHEDULED_UPGRADE.ACCOUNT_ID.notIn(accountsToIgnore)))
.orderBy(SCHEDULED_UPGRADE.PRIORITY.desc(), SCHEDULED_UPGRADE.CREATED.asc())
.limit(max * 4)
.fetchInto(ScheduledUpgradeRecord.class);

代码示例来源:origin: k55k32/cms-admin-end

public List<Article> findAll(int status) {
  final Field<?> catalogName = C_CATALOG.NAME.as("catalogName");
  List<Article> list = dao.execute(e -> {
    return e.select(Fields.all(C_ARTICLE.fields(),catalogName))
    .from(C_ARTICLE)
    .leftJoin(C_CATALOG).on(C_ARTICLE.CATALOG_ID.eq(C_CATALOG.ID))
    .where(C_ARTICLE.STATUS.eq(status))
    .orderBy(C_ARTICLE.CREATE_TIME.desc());
  }).fetch(r -> {
    Article art = r.into(Article.class);
    art.setCatalogName(r.get(catalogName, String.class));
    return art;
  });
  return list;
}

代码示例来源:origin: com.walmartlabs.concord.server/concord-server

public List<EventMarker> listMarkers(String processorName) {
  return txResult(tx -> tx.selectFrom(EVENT_PROCESSOR_MARKER)
      .where(EVENT_PROCESSOR_MARKER.PROCESSOR_NAME.eq(processorName)
          .and(EVENT_PROCESSOR_MARKER.STATUS.eq(MarkerStatus.IN_PROCESS.name())))
      .orderBy(EVENT_PROCESSOR_MARKER.START_FROM.desc()))
      .fetch(e -> EventMarker.builder()
          .startFrom(e.getStartFrom())
          .endTo(e.getEndTo())
          .eventDate(e.getEventDate())
          .eventSeq(e.getEventSeq())
          .build());
}

代码示例来源:origin: rancher/cattle

@Override
public Instance findOneInstanceForService(long serviceId) {
  Instance last = null;
  List<? extends Instance> instances = create()
      .select(INSTANCE.fields())
      .from(INSTANCE)
      .join(SERVICE_EXPOSE_MAP)
        .on(SERVICE_EXPOSE_MAP.INSTANCE_ID.eq(INSTANCE.ID))
      .where(INSTANCE.REMOVED.isNull()
          .and(SERVICE_EXPOSE_MAP.SERVICE_ID.eq(serviceId))
          .and(SERVICE_EXPOSE_MAP.REMOVED.isNull()))
      .orderBy(INSTANCE.CREATED.desc())
      .fetchInto(InstanceRecord.class);
  for (Instance instance : instances) {
    last = instance;
    if (last.getFirstRunning() != null) {
      return last;
    }
  }
  return last;
}

代码示例来源:origin: org.jooq/jooq-meta

.where(p.RDB$PROCEDURE_NAME.eq(getName()))
.orderBy(
  p.RDB$PARAMETER_TYPE.desc(),
  p.RDB$PARAMETER_NUMBER.asc())) {

代码示例来源:origin: k55k32/cms-admin-end

public ArticleDetail getDetail(String id) {
  CArticle article = C_ARTICLE.as("a");
  CArticle before = C_ARTICLE.as("b");
  CArticle next = C_ARTICLE.as("n");
  CArticle inner = C_ARTICLE.as("i");
  ArticleDetail a = dao.execute(e -> {
    return e.select(Fields.all(article.fields(),
      before.ID.as("beforeId"),
      before.TITLE.as("beforeTitle"),
      next.ID.as("nextId"),
      next.TITLE.as("nextTitle")
      )).from(article)
      .leftJoin(before).on(before.ID.eq(e.select(inner.ID).from(inner).where(article.CREATE_TIME.ge(inner.CREATE_TIME)).and(inner.ID.ne(article.ID).and(inner.STATUS.eq(Article.STATUS_PUBLISH))).orderBy(inner.CREATE_TIME.desc()).limit(0, 1)))
      .leftJoin(next).on((next.ID.eq(e.select(inner.ID).from(inner).where(article.CREATE_TIME.le(inner.CREATE_TIME)).and(inner.ID.ne(article.ID).and(inner.STATUS.eq(Article.STATUS_PUBLISH))).orderBy(inner.CREATE_TIME).limit(0, 1))))
      .where(article.ID.eq(id))
      .fetchOne(r -> {
        return dao.mapperEntityEx(r, ArticleDetail.class);
      });
  });
  List<Tag> tags = articleTagService.findTags(a.getId());
  a.setTags(tags);
  return a;
}

代码示例来源:origin: com.walmartlabs.concord.server/concord-server

return s.orderBy(pq.CREATED_AT.desc())
    .limit(limit)
    .offset(offset)

相关文章