org.jooq.TableField类的使用及代码示例

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

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

TableField介绍

[英]A field contained in a table
[中]表中包含的字段

代码示例

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

public void removeUsers(DSLContext tx, UUID teamId, Collection<UUID> userIds) {
  if (userIds == null || userIds.isEmpty()) {
    return;
  }
  tx.deleteFrom(USER_TEAMS)
      .where(USER_TEAMS.TEAM_ID.eq(teamId)
          .and(USER_TEAMS.USER_ID.in(userIds)))
      .execute();
}

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

protected Condition processCondition(String resourceType, String resourceId) {
  if (resourceType == null) {
    return PROCESS_INSTANCE.END_TIME.isNull();
  } else {
    return PROCESS_INSTANCE.END_TIME.isNull().and(PROCESS_INSTANCE.RESOURCE_TYPE.eq(resourceType)).and(PROCESS_INSTANCE.RESOURCE_ID.eq(resourceId));
  }
}

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

@Override
public List<Long> getAgentProviderIgnoreHealth(String providedServiceLabel, long accountId) {
  return Arrays.asList(create().select(INSTANCE.AGENT_ID)
      .from(INSTANCE)
      .join(INSTANCE_LABEL_MAP)
        .on(INSTANCE_LABEL_MAP.INSTANCE_ID.eq(INSTANCE.ID))
      .join(LABEL)
        .on(LABEL.ID.eq(INSTANCE_LABEL_MAP.LABEL_ID).and(LABEL.KEY.eq(providedServiceLabel)))
      .where(INSTANCE.ACCOUNT_ID.eq(accountId)
          .and(INSTANCE.AGENT_ID.isNotNull())
          .and(INSTANCE.SYSTEM.isTrue())
          .and(INSTANCE.STATE.in(InstanceConstants.STATE_RUNNING, InstanceConstants.STATE_STARTING)))
      .orderBy(INSTANCE.AGENT_ID.asc())
      .fetch().intoArray(INSTANCE.AGENT_ID));
}

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

protected Condition elligibleHostCondition() {
  return AGENT.ID.isNull().or(AGENT.STATE.eq(CommonStatesConstants.ACTIVE))
      .and(HOST.STATE.in(CommonStatesConstants.ACTIVE, CommonStatesConstants.UPDATING_ACTIVE))
      .and(STORAGE_POOL.STATE.eq(CommonStatesConstants.ACTIVE));
}

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

private SelectConditionStep<Record> schemaQuery(long accountId, String role) {
  return create()
      .select()
      .from(DYNAMIC_SCHEMA).leftOuterJoin(DYNAMIC_SCHEMA_ROLE)
      .on(DYNAMIC_SCHEMA_ROLE.DYNAMIC_SCHEMA_ID.eq(DYNAMIC_SCHEMA.ID))
      .where(DYNAMIC_SCHEMA.ACCOUNT_ID.eq(accountId)
          .and(DYNAMIC_SCHEMA_ROLE.ROLE.eq(role))
          .and(DYNAMIC_SCHEMA.STATE.ne(CommonStatesConstants.PURGED)))
      .or(DYNAMIC_SCHEMA.ACCOUNT_ID.eq(accountId)
          .and(DYNAMIC_SCHEMA_ROLE.ROLE.isNull())
          .and(DYNAMIC_SCHEMA.STATE.ne(CommonStatesConstants.PURGED)))
      .or(DYNAMIC_SCHEMA_ROLE.ROLE.eq(role)
          .and(DYNAMIC_SCHEMA.ACCOUNT_ID.isNull())
          .and(DYNAMIC_SCHEMA.STATE.ne(CommonStatesConstants.PURGED)));
}

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

@Override
public List<? extends ProjectMember> findBadProjectMembers(int count) {
  return create().select(PROJECT_MEMBER.fields())
      .from(PROJECT_MEMBER)
      .join(ACCOUNT)
        .on(ACCOUNT.ID.eq(PROJECT_MEMBER.PROJECT_ID))
      .where(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED)
          .and(PROJECT_MEMBER.REMOVED.isNull())
          .and(PROJECT_MEMBER.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING)))
      .limit(count)
      .fetchInto(ProjectMemberRecord.class);
}

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

protected List<? extends ConfigItemStatus> stackMigrationItems() {
  return create()
      .select(CONFIG_ITEM_STATUS.fields())
      .from(CONFIG_ITEM_STATUS)
      .join(STACK)
      .on(STACK.ID.eq(CONFIG_ITEM_STATUS.STACK_ID))
      .join(CONFIG_ITEM)
      .on(CONFIG_ITEM.NAME.eq(CONFIG_ITEM_STATUS.NAME))
      .where(CONFIG_ITEM_STATUS.SOURCE_VERSION.isNotNull()
          .and(CONFIG_ITEM_STATUS.SOURCE_VERSION.ne(CONFIG_ITEM.SOURCE_VERSION))
          .and(STACK.REMOVED.isNull()))
      .limit(BATCH_SIZE.get())
      .fetchInto(ConfigItemStatusRecord.class);
}

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

@Override
public List<? extends ServiceExposeMap> getNonRemovedServiceHostnameMaps(long serviceId) {
  return create()
      .select(SERVICE_EXPOSE_MAP.fields())
      .from(SERVICE_EXPOSE_MAP)
      .where(SERVICE_EXPOSE_MAP.SERVICE_ID.eq(serviceId))
      .and(SERVICE_EXPOSE_MAP.REMOVED.isNull()
          .and(SERVICE_EXPOSE_MAP.STATE.notIn(CommonStatesConstants.REMOVED,
              CommonStatesConstants.REMOVING))
          .and(SERVICE_EXPOSE_MAP.HOST_NAME.isNotNull()))
      .fetchInto(ServiceExposeMapRecord.class);
}

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

@Override
public Account getAdminAccountExclude(long accountId) {
  return create()
      .selectFrom(ACCOUNT)
      .where(ACCOUNT.STATE.in(getAccountActiveStates())
          .and(ACCOUNT.KIND.eq(AccountConstants.ADMIN_KIND))
          .and(ACCOUNT.ID.ne(accountId)))
      .orderBy(ACCOUNT.ID.asc()).limit(1).fetchOne();
}

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

@Override
public Account getAccountByUuid(String uuid) {
  return create()
      .selectFrom(ACCOUNT)
      .where(ACCOUNT.UUID.eq(uuid)
          .and(ACCOUNT.STATE.in(getActiveStates())))
      .orderBy(ACCOUNT.ID.asc()).limit(1).fetchOne();
}

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

@Override
public List<? extends Stack> getStacksThatMatch(Collection<String> currentIds) {
  return create().select(STACK.fields())
    .from(STACK)
    .leftOuterJoin(SCHEDULED_UPGRADE)
      .on(SCHEDULED_UPGRADE.STACK_ID.eq(STACK.ID)
          .and(SCHEDULED_UPGRADE.REMOVED.isNull())
          .and(SCHEDULED_UPGRADE.FINISHED.isNull()))
    .where(STACK.REMOVED.isNull()
        .and(STACK.SYSTEM.isTrue())
        .and(STACK.EXTERNAL_ID.in(currentIds))
        .and(SCHEDULED_UPGRADE.ID.isNull()))
    .fetchInto(StackRecord.class);
}

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

@Override
public List<? extends ProjectMember> getActiveProjectMembers(long id) {
  return create()
      .selectFrom(PROJECT_MEMBER)
      .where(PROJECT_MEMBER.PROJECT_ID.eq(id))
      .and(PROJECT_MEMBER.STATE.eq(CommonStatesConstants.ACTIVE))
      .and(PROJECT_MEMBER.REMOVED.isNull())
      .orderBy(PROJECT_MEMBER.ID.asc()).fetch();
}

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

@Override
public List<Long> getInstancesWithVolumeMounted(long volumeId, long currentInstanceId) {
  return create()
      .select(INSTANCE.ID)
      .from(INSTANCE)
      .join(MOUNT)
        .on(MOUNT.INSTANCE_ID.eq(INSTANCE.ID).and(MOUNT.VOLUME_ID.eq(volumeId)))
      .join(INSTANCE_HOST_MAP)
        .on(INSTANCE_HOST_MAP.INSTANCE_ID.eq(INSTANCE.ID))
      .where(INSTANCE.REMOVED.isNull()
        .and(INSTANCE.ID.ne(currentInstanceId))
        .and(INSTANCE_HOST_MAP.STATE.notIn(IHM_STATES))
        .and((INSTANCE.HEALTH_STATE.isNull().or(INSTANCE.HEALTH_STATE.eq(HealthcheckConstants.HEALTH_STATE_HEALTHY)))))
      .fetchInto(Long.class);
}

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

@Override
public List<Account> searchUsers(String username) {
  return create()
      .select(ACCOUNT.fields())
      .from(ACCOUNT)
      .join(CREDENTIAL)
      .on(CREDENTIAL.ACCOUNT_ID.eq(ACCOUNT.ID))
      .where(ACCOUNT.STATE.in(getActiveStates())
          .and(CREDENTIAL.STATE.eq(CommonStatesConstants.ACTIVE))
          .and(CREDENTIAL.PUBLIC_VALUE.contains(username))
          .and(CREDENTIAL.KIND.eq(CredentialConstants.KIND_PASSWORD)))
      .orderBy(ACCOUNT.ID.asc()).fetchInto(Account.class);
}

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

@Override
public List<? extends InstanceLink> findServiceBasedInstanceLinks(long instanceId) {
  return create()
      .select(INSTANCE_LINK.fields())
      .from(INSTANCE_LINK)
      .where(INSTANCE_LINK.INSTANCE_ID.eq(instanceId)
          .and(INSTANCE_LINK.SERVICE_CONSUME_MAP_ID.isNotNull())
          .and(INSTANCE_LINK.REMOVED.isNull()))
      .fetchInto(InstanceLinkRecord.class);
}

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

@Override
public Account getAccountByExternalId(String externalId, String externalType) {
  return create()
      .selectFrom(ACCOUNT)
      .where(
          ACCOUNT.EXTERNAL_ID.eq(externalId)
              .and(ACCOUNT.EXTERNAL_ID_TYPE.eq(externalType))
              .and(ACCOUNT.STATE.ne("purged"))
      ).orderBy(ACCOUNT.ID.asc()).fetchOne();
}

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

@Override
public List<? extends Host> getHosts(Long accountId, List<String> uuids) {
  return create()
    .selectFrom(HOST)
    .where(HOST.ACCOUNT_ID.eq(accountId)
    .and(HOST.STATE.notIn(CommonStatesConstants.REMOVED, CommonStatesConstants.REMOVING))
    .and(HOST.UUID.in(uuids))).fetch();
}

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

@Override
public List<? extends Service> getSkipServices(long accountId) {
  return create()
      .select(SERVICE.fields())
      .from(SERVICE)
      .where(SERVICE.ACCOUNT_ID.eq(accountId)
          .and(SERVICE.REMOVED.isNull())
          .and(SERVICE.SKIP.isTrue()))
      .fetchInto(ServiceRecord.class);
}

相关文章