Пример #1
0
  @Override
  public void appendValues(final List<Object> values) {
    where.appendElementValues(values);
    groupBy.appendElementValues(values);

    unions.forEach(select -> select.appendValues(values));
    unionAlls.forEach(select -> select.appendValues(values));
    excepts.forEach(select -> select.appendValues(values));
    intersects.forEach(select -> select.appendValues(values));
  }
Пример #2
0
  private void renderSQLWithoutPagination(final DBProfile dbProfile, final StringBuilder builder) {
    builder.append("SELECT "); // $NON-NLS-1$
    if (distinct) {
      builder.append("DISTINCT "); // $NON-NLS-1$
    }

    int size = selectFields.length;
    boolean first = true;
    for (int i = 0; i < size; i++) {
      String field = selectFields[i];
      if (!first) {
        builder.append(", "); // $NON-NLS-1$
      } else {
        first = false;
      }

      final Matcher m = patternSelectClause.matcher(field);
      boolean loop = m.find();
      while (loop) {
        solveField(m.group().trim(), builder, nameSolver);
        loop = m.find();
        if (loop) {
          builder.append(", "); // $NON-NLS-1$
        }
      }
    }

    builder.append(" "); // $NON-NLS-1$
    from.renderSqlElement(dbProfile, builder, nameSolver);
    where.renderSqlElement(dbProfile, builder, nameSolver);
    groupBy.renderSqlElement(dbProfile, builder, nameSolver);
    orderBy.renderSqlElement(dbProfile, builder, nameSolver);
    render(SQL_UNION, unions, dbProfile, builder);
    render(SQL_UNION_ALL, unionAlls, dbProfile, builder);
    render(SQL_EXCEPT, excepts, dbProfile, builder);
    render(SQL_INTERSECT, intersects, dbProfile, builder);

    builder.append(lockMode.getMode());
  }