コード例 #1
0
  public static SqlOpQuery makeSelectOrTable(SqlOpQuery node) {
    String alias = aliasGenerator.next();

    SqlOpQuery result = new SqlOpQuery(node.getSchema(), node.getQueryString(), alias);

    return result;
  }
コード例 #2
0
  public static SqlOpSelectBlock makeSelect(SqlOpQuery node) {

    SqlOpQuery opQuery = makeSelectOrTable(node);

    SqlOpSelectBlock result = SqlOpSelectBlock.create(opQuery);

    for (String columnName : opQuery.getSchema().getColumnNames()) {
      result
          .getProjection()
          .put(columnName, new ExprVar(opQuery.getAliasName() + "." + columnName));
    }

    return result;
  }