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

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

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

TableField.like介绍

暂无

代码示例

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

public PageResult<Article> page(PageResult<Article> page, Integer status, Optional<String> catalogId, String ...keywords) {
  CArticle table = C_ARTICLE;
  List<Condition> cons = new ArrayList<>();
  cons.add(table.STATUS.eq(Article.STATUS_PUBLISH));
  catalogId.ifPresent(cid -> {
    if ("-1".equals(cid)) {
      cons.add(table.CATALOG_ID.isNull().or(table.CATALOG_ID.eq("")));
    } else if (!"0".equals(cid)) {
      cons.add(table.CATALOG_ID.eq(cid));
    }
  });
  List<Condition> kwCons = new ArrayList<>();
  Arrays.asList(keywords).forEach(k -> {
    if (k.trim().length() > 0) {
      String kwLike = "%" + k + "%";
      kwCons.add(table.TITLE.like(kwLike));
      kwCons.add(table.CONTENT.like(kwLike));
      kwCons.add(table.TAG_NAMES.like(kwLike));
    }
  });
  cons.add(kwCons.stream().reduce((a, b) -> a.or(b)).orElse(DSL.trueCondition()));
  return searchPageByCondition(page, cons.stream());
}

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

@Override
  public List<? extends Agent> findAgentsToRemove() {
    if (startTime == null) {
      startTime = System.currentTimeMillis();
    }

    if ((System.currentTimeMillis() - startTime) <= (HostDao.HOST_REMOVE_START_DELAY.get() * 1000)) {
      return Collections.emptyList();
    }

    List<? extends Agent> agents = create().select(AGENT.fields())
        .from(AGENT)
        .leftOuterJoin(HOST)
          .on(HOST.AGENT_ID.eq(AGENT.ID))
        .where(HOST.ID.isNull().or(HOST.REMOVED.isNotNull())
            .and(AGENT.STATE.eq(AgentConstants.STATE_DISCONNECTED)))
        .fetchInto(AgentRecord.class);

    // This is purging old pre-1.2 agent delegates
    List<? extends Agent> oldAgents = create().select(AGENT.fields())
        .from(AGENT)
        .where(AGENT.REMOVED.isNull().and(AGENT.URI.like("delegate%")))
        .fetchInto(AgentRecord.class);

    List<Agent> result = new ArrayList<>(agents);
    result.addAll(oldAgents);

    return result;
  }
}

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

@Override
public String getPublicCA() {
  Record1<String> r = create().select(CERTIFICATE.CERT_CHAIN)
      .from(CERTIFICATE)
      .join(ACCOUNT)
        .on(ACCOUNT.ID.eq(CERTIFICATE.ACCOUNT_ID))
      .where(CERTIFICATE.STATE.eq(CommonStatesConstants.ACTIVE)
          .and(ACCOUNT.UUID.like("system-ha-%")))
      .fetchAny();
  return r == null ? null : r.value1();
}

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

return field.like(condition.getValue().toString());
case LT:
  return field.lt(condition.getValue());
  return field.isNull();
case PREFIX:
  return field.like(condition.getValue() + "%");
case OR:
  return toCondition(field, condition.getLeft()).or(toCondition(field, condition.getRight()));

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

@Override
  public boolean isSchedulerServiceEnabled(Long accountId) {
    return create()
        .select(SERVICE.ID)
        .from(SERVICE)
        .where(SERVICE.ACCOUNT_ID.equal(accountId)
        .and(SERVICE.SYSTEM.isTrue())
        .and(SERVICE.REMOVED.isNull())
        .and(SERVICE.STATE.notIn(INACTIVE_STATES))
        .and(SERVICE.DATA.like("%io.rancher.container.agent_service.scheduling%"))).fetch().size() > 0;
  }
}

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

.from(COLUMNS)
.where(
  Columns.COLUMN_TYPE.like("ENUM(%)%").and(
  Columns.TABLE_SCHEMA.in(getInputSchemata())))
.orderBy(

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

.from(COLUMNS)
.where(
  Columns.COLUMN_TYPE.like("enum(%)").and(

相关文章