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

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

本文整理了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

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

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

  1. private <T> ArrayList<T> forkList(ArrayList<T> list) {
  2. if (isEmpty(list)) {
  3. return null;
  4. }
  5. return new ArrayList<>(list);
  6. }

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

  1. private void visitJoinClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(joins)) {
  3. return;
  4. }
  5. builder.sql.append(" ");
  6. builder.appendConcatenatedCompilables(joins, " ", forSqlValidation);
  7. }

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

  1. private void visitWhereClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(criterions)) {
  3. return;
  4. }
  5. builder.sql.append(" WHERE ");
  6. if (forSqlValidation) {
  7. builder.sql.append("(");
  8. }
  9. builder.appendConcatenatedCompilables(criterions, " AND ", forSqlValidation);
  10. if (forSqlValidation) {
  11. builder.sql.append(")");
  12. }
  13. }

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

  1. private void visitCompoundSelectClauses(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(compoundSelects)) {
  3. return;
  4. }
  5. builder.sql.append(" ");
  6. builder.appendConcatenatedCompilables(compoundSelects, " ", forSqlValidation);
  7. }

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

  1. private Query(Field<?>... fields) {
  2. if (!isEmpty(fields)) {
  3. this.fields = new ArrayList<>();
  4. SquidUtilities.addAll(this.fields, fields);
  5. }
  6. }

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

  1. private void visitOrderByClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(orders)) {
  3. return;
  4. }
  5. builder.sql.append(" ORDER BY ");
  6. builder.appendConcatenatedCompilables(orders, ", ", forSqlValidation);
  7. }

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

  1. private void visitGroupByClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(groupByFields)) {
  3. return;
  4. }
  5. builder.sql.append(" GROUP BY");
  6. for (Field<?> groupBy : groupByFields) {
  7. builder.sql.append(" ");
  8. groupBy.appendQualifiedExpression(builder, forSqlValidation);
  9. builder.sql.append(",");
  10. }
  11. builder.sql.deleteCharAt(builder.sql.length() - 1);
  12. if (isEmpty(havings)) {
  13. return;
  14. }
  15. builder.sql.append(" HAVING ");
  16. builder.appendConcatenatedCompilables(havings, " AND ", forSqlValidation);
  17. }

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

  1. private void visitSelectClause(SqlBuilder builder, boolean forSqlValidation) {
  2. builder.sql.append("SELECT ");
  3. if (distinct) {
  4. builder.sql.append("DISTINCT ");
  5. }
  6. List<Field<?>> toSelect;
  7. if (isEmpty(fields)) {
  8. // SELECT * may yield unexpected column names, so we get the full list of fields to specify explicit aliases
  9. toSelect = getFields();
  10. } else {
  11. toSelect = fields;
  12. }
  13. builder.appendConcatenatedCompilables(toSelect, ", ", forSqlValidation);
  14. }

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

  1. /**
  2. * @return the {@link Field Fields} this query selects
  3. */
  4. public List<Field<?>> getFields() {
  5. if (isEmpty(selectAllCache)) {
  6. if (selectAllCache == null) {
  7. selectAllCache = new ArrayList<>();
  8. }
  9. if (!isEmpty(fields)) {
  10. selectAllCache.addAll(fields);
  11. } else {
  12. SquidUtilities.addAll(selectAllCache, table.allFields());
  13. if (joins != null) {
  14. for (Join join : joins) {
  15. SquidUtilities.addAll(selectAllCache, join.joinTable.allFields());
  16. }
  17. }
  18. }
  19. }
  20. return new ArrayList<>(selectAllCache);
  21. }

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

  1. /**
  2. * Add more {@link Field Fields} to be selected
  3. *
  4. * @param fields the additional Fields to be selected
  5. * @return this Query object, to allow chaining method calls
  6. */
  7. public Query selectMore(List<Field<?>> fields) {
  8. if (immutable) {
  9. return fork().selectMore(fields);
  10. }
  11. if (!isEmpty(fields)) {
  12. if (this.fields == null) {
  13. this.fields = new ArrayList<>(fields);
  14. } else {
  15. this.fields.addAll(fields);
  16. }
  17. if (selectAllCache != null) {
  18. selectAllCache.clear();
  19. }
  20. invalidateCompileCache();
  21. }
  22. return this;
  23. }

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

  1. /**
  2. * Add more {@link Field Fields} to be selected
  3. *
  4. * @param fields the additional Fields to be selected
  5. * @return this Query object, to allow chaining method calls
  6. */
  7. public Query selectMore(Field<?>... fields) {
  8. if (immutable) {
  9. return fork().selectMore(fields);
  10. }
  11. if (!isEmpty(fields)) {
  12. if (this.fields == null) {
  13. this.fields = new ArrayList<>();
  14. }
  15. SquidUtilities.addAll(this.fields, fields);
  16. if (selectAllCache != null) {
  17. selectAllCache.clear();
  18. }
  19. invalidateCompileCache();
  20. }
  21. return this;
  22. }

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

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

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

  1. private <T> ArrayList<T> forkList(ArrayList<T> list) {
  2. if (isEmpty(list)) {
  3. return null;
  4. }
  5. return new ArrayList<>(list);
  6. }

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

  1. private void visitJoinClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(joins)) {
  3. return;
  4. }
  5. builder.sql.append(" ");
  6. builder.appendConcatenatedCompilables(joins, " ", forSqlValidation);
  7. }

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

  1. private void visitCompoundSelectClauses(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(compoundSelects)) {
  3. return;
  4. }
  5. builder.sql.append(" ");
  6. builder.appendConcatenatedCompilables(compoundSelects, " ", forSqlValidation);
  7. }

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

  1. private Query(Field<?>... fields) {
  2. if (!isEmpty(fields)) {
  3. this.fields = new ArrayList<>();
  4. SquidUtilities.addAll(this.fields, fields);
  5. }
  6. }

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

  1. private void visitOrderByClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(orders)) {
  3. return;
  4. }
  5. builder.sql.append(" ORDER BY ");
  6. builder.appendConcatenatedCompilables(orders, ", ", forSqlValidation);
  7. }

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

  1. private void visitWhereClause(SqlBuilder builder, boolean forSqlValidation) {
  2. if (isEmpty(criterions)) {
  3. return;
  4. }
  5. builder.sql.append(" WHERE ");
  6. if (forSqlValidation) {
  7. builder.sql.append("(");
  8. }
  9. builder.appendConcatenatedCompilables(criterions, " AND ", forSqlValidation);
  10. if (forSqlValidation) {
  11. builder.sql.append(")");
  12. }
  13. }

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

  1. private void visitSelectClause(SqlBuilder builder, boolean forSqlValidation) {
  2. builder.sql.append("SELECT ");
  3. if (distinct) {
  4. builder.sql.append("DISTINCT ");
  5. }
  6. List<Field<?>> toSelect;
  7. if (isEmpty(fields)) {
  8. // SELECT * may yield unexpected column names, so we get the full list of fields to specify explicit aliases
  9. toSelect = getFields();
  10. } else {
  11. toSelect = fields;
  12. }
  13. builder.appendConcatenatedCompilables(toSelect, ", ", forSqlValidation);
  14. }

相关文章