예제 #1
0
  @Override
  public void visit(SelectExpressionItem selectExpressionItem) {
    if (firstRun) {
      if (selectExpressionItem.getAlias() != null) {
        aliases.add(selectExpressionItem.getAlias().getName().toUpperCase());
      }
    } else {
      if (selectExpressionItem.getAlias() == null) {

        while (true) {
          String alias = getNextAlias().toUpperCase();
          if (!aliases.contains(alias)) {
            aliases.add(alias);
            selectExpressionItem.setAlias(new Alias(alias));
            break;
          }
        }
      }
    }
  }
예제 #2
0
 @Override
 public void visit(PlainSelect plainSelect) {
   firstRun = true;
   counter = 0;
   aliases.clear();
   for (SelectItem item : plainSelect.getSelectItems()) {
     item.accept(this);
   }
   firstRun = false;
   for (SelectItem item : plainSelect.getSelectItems()) {
     item.accept(this);
   }
 }