com.yahoo.squidb.sql.Query.isEmpty()方法的使用及代码示例

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

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

Query.isEmpty介绍

暂无

代码示例

代码示例来源:origin: yahoo/squidb

private Query(List<Field<?>> fields) {
  if (!isEmpty(fields)) {
    this.fields = new ArrayList<>(fields);
  }
}

代码示例来源:origin: yahoo/squidb

private <T> ArrayList<T> forkList(ArrayList<T> list) {
  if (isEmpty(list)) {
    return null;
  }
  return new ArrayList<>(list);
}

代码示例来源:origin: yahoo/squidb

private void visitJoinClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(joins)) {
    return;
  }
  builder.sql.append(" ");
  builder.appendConcatenatedCompilables(joins, " ", forSqlValidation);
}

代码示例来源:origin: yahoo/squidb

private void visitWhereClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(criterions)) {
    return;
  }
  builder.sql.append(" WHERE ");
  if (forSqlValidation) {
    builder.sql.append("(");
  }
  builder.appendConcatenatedCompilables(criterions, " AND ", forSqlValidation);
  if (forSqlValidation) {
    builder.sql.append(")");
  }
}

代码示例来源:origin: yahoo/squidb

private void visitCompoundSelectClauses(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(compoundSelects)) {
    return;
  }
  builder.sql.append(" ");
  builder.appendConcatenatedCompilables(compoundSelects, " ", forSqlValidation);
}

代码示例来源:origin: yahoo/squidb

private Query(Field<?>... fields) {
  if (!isEmpty(fields)) {
    this.fields = new ArrayList<>();
    SquidUtilities.addAll(this.fields, fields);
  }
}

代码示例来源:origin: yahoo/squidb

private void visitOrderByClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(orders)) {
    return;
  }
  builder.sql.append(" ORDER BY ");
  builder.appendConcatenatedCompilables(orders, ", ", forSqlValidation);
}

代码示例来源:origin: yahoo/squidb

private void visitGroupByClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(groupByFields)) {
    return;
  }
  builder.sql.append(" GROUP BY");
  for (Field<?> groupBy : groupByFields) {
    builder.sql.append(" ");
    groupBy.appendQualifiedExpression(builder, forSqlValidation);
    builder.sql.append(",");
  }
  builder.sql.deleteCharAt(builder.sql.length() - 1);
  if (isEmpty(havings)) {
    return;
  }
  builder.sql.append(" HAVING ");
  builder.appendConcatenatedCompilables(havings, " AND ", forSqlValidation);
}

代码示例来源:origin: yahoo/squidb

private void visitSelectClause(SqlBuilder builder, boolean forSqlValidation) {
  builder.sql.append("SELECT ");
  if (distinct) {
    builder.sql.append("DISTINCT ");
  }
  List<Field<?>> toSelect;
  if (isEmpty(fields)) {
    // SELECT * may yield unexpected column names, so we get the full list of fields to specify explicit aliases
    toSelect = getFields();
  } else {
    toSelect = fields;
  }
  builder.appendConcatenatedCompilables(toSelect, ", ", forSqlValidation);
}

代码示例来源:origin: yahoo/squidb

/**
 * @return the {@link Field Fields} this query selects
 */
public List<Field<?>> getFields() {
  if (isEmpty(selectAllCache)) {
    if (selectAllCache == null) {
      selectAllCache = new ArrayList<>();
    }
    if (!isEmpty(fields)) {
      selectAllCache.addAll(fields);
    } else {
      SquidUtilities.addAll(selectAllCache, table.allFields());
      if (joins != null) {
        for (Join join : joins) {
          SquidUtilities.addAll(selectAllCache, join.joinTable.allFields());
        }
      }
    }
  }
  return new ArrayList<>(selectAllCache);
}

代码示例来源:origin: yahoo/squidb

/**
 * Add more {@link Field Fields} to be selected
 *
 * @param fields the additional Fields to be selected
 * @return this Query object, to allow chaining method calls
 */
public Query selectMore(List<Field<?>> fields) {
  if (immutable) {
    return fork().selectMore(fields);
  }
  if (!isEmpty(fields)) {
    if (this.fields == null) {
      this.fields = new ArrayList<>(fields);
    } else {
      this.fields.addAll(fields);
    }
    if (selectAllCache != null) {
      selectAllCache.clear();
    }
    invalidateCompileCache();
  }
  return this;
}

代码示例来源:origin: yahoo/squidb

/**
 * Add more {@link Field Fields} to be selected
 *
 * @param fields the additional Fields to be selected
 * @return this Query object, to allow chaining method calls
 */
public Query selectMore(Field<?>... fields) {
  if (immutable) {
    return fork().selectMore(fields);
  }
  if (!isEmpty(fields)) {
    if (this.fields == null) {
      this.fields = new ArrayList<>();
    }
    SquidUtilities.addAll(this.fields, fields);
    if (selectAllCache != null) {
      selectAllCache.clear();
    }
    invalidateCompileCache();
  }
  return this;
}

代码示例来源:origin: com.yahoo.squidb/squidb

private Query(List<Field<?>> fields) {
  if (!isEmpty(fields)) {
    this.fields = new ArrayList<>(fields);
  }
}

代码示例来源:origin: com.yahoo.squidb/squidb

private <T> ArrayList<T> forkList(ArrayList<T> list) {
  if (isEmpty(list)) {
    return null;
  }
  return new ArrayList<>(list);
}

代码示例来源:origin: com.yahoo.squidb/squidb

private void visitJoinClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(joins)) {
    return;
  }
  builder.sql.append(" ");
  builder.appendConcatenatedCompilables(joins, " ", forSqlValidation);
}

代码示例来源:origin: com.yahoo.squidb/squidb

private void visitCompoundSelectClauses(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(compoundSelects)) {
    return;
  }
  builder.sql.append(" ");
  builder.appendConcatenatedCompilables(compoundSelects, " ", forSqlValidation);
}

代码示例来源:origin: com.yahoo.squidb/squidb

private Query(Field<?>... fields) {
  if (!isEmpty(fields)) {
    this.fields = new ArrayList<>();
    SquidUtilities.addAll(this.fields, fields);
  }
}

代码示例来源:origin: com.yahoo.squidb/squidb

private void visitOrderByClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(orders)) {
    return;
  }
  builder.sql.append(" ORDER BY ");
  builder.appendConcatenatedCompilables(orders, ", ", forSqlValidation);
}

代码示例来源:origin: com.yahoo.squidb/squidb

private void visitWhereClause(SqlBuilder builder, boolean forSqlValidation) {
  if (isEmpty(criterions)) {
    return;
  }
  builder.sql.append(" WHERE ");
  if (forSqlValidation) {
    builder.sql.append("(");
  }
  builder.appendConcatenatedCompilables(criterions, " AND ", forSqlValidation);
  if (forSqlValidation) {
    builder.sql.append(")");
  }
}

代码示例来源:origin: com.yahoo.squidb/squidb

private void visitSelectClause(SqlBuilder builder, boolean forSqlValidation) {
  builder.sql.append("SELECT ");
  if (distinct) {
    builder.sql.append("DISTINCT ");
  }
  List<Field<?>> toSelect;
  if (isEmpty(fields)) {
    // SELECT * may yield unexpected column names, so we get the full list of fields to specify explicit aliases
    toSelect = getFields();
  } else {
    toSelect = fields;
  }
  builder.appendConcatenatedCompilables(toSelect, ", ", forSqlValidation);
}

相关文章