예제 #1
0
  public boolean visit(SQLIdentifierExpr x) {
    String currentTable = getCurrentTable();

    if (subQueryMap.containsKey(currentTable)) {
      return false;
    }

    String ident = x.toString();

    if (variants.containsKey(ident)) {
      return false;
    }

    Column column;
    if (currentTable != null) {
      column = addColumn(currentTable, ident);
      x.putAttribute(ATTR_COLUMN, column);
    } else {
      column = handleUnkownColumn(ident);
      if (column != null) {
        x.putAttribute(ATTR_COLUMN, column);
      }
    }
    if (column != null) {
      setColumn(x, column);
    }
    return false;
  }
예제 #2
0
  public boolean visit(SQLPropertyExpr x) {
    if (x.getOwner() instanceof SQLIdentifierExpr) {
      String owner = ((SQLIdentifierExpr) x.getOwner()).getName();

      if (subQueryMap.containsKey(owner)) {
        return false;
      }

      owner = aliasWrap(owner);

      if (owner != null) {
        Column column = addColumn(owner, x.getName());
        x.putAttribute(ATTR_COLUMN, column);
        if (column != null) {
          if (column != null) {
            setColumn(x, column);
          }
        }
      }
    }
    return false;
  }