code: public Integer getNewTableIndex(final String _tableName,
                                      final String _column,
                                      final Integer _relIndex,
                                      final Long _clazzId)
      {
          final int ret;
          if (this.valueSelect == null && this.fromSelect != null) {
              ret = this.fromSelect.getNewTableIndex(_tableName, _column, _relIndex, _clazzId);
          } else {
              ret = this.query.getNewTableIndex(_tableName, _column, _relIndex, _clazzId);
          }
          return ret;
      }
docs: Get a new table index and add the table to the map of existing table
  indexes. The method calls in case that this OneSelect is related
  to a FromSelect the method
  {@link org.efaps.db.PrintQuery.FromSelect#getNewTableIndex(String, Integer)},
  else in PrintQuery the method
  {@link org.efaps.db.PrintQuery#getNewTableIndex(String, Integer)}.
  
  @param _tableName    tablename the index is wanted for
  @param _column       name of the column, used for the relation
  @param _relIndex     relation the table is used in
  @param _clazzId      optional id of the classification
  @return new index for the table