示例#1
0
  public ITable getTable(String tableName) throws DataSetException {
    logger.debug("getTable(tableName={}) - start", tableName);

    initialize();

    ITable found = (ITable) _orderedTableNameMap.get(tableName);
    if (found != null) {
      return found;
    } else {
      throw new NoSuchTableException(tableName);
    }
  }
示例#2
0
  /**
   * Initializes the tables of this dataset
   *
   * @throws DataSetException
   * @since 2.4
   */
  private void initialize() throws DataSetException {
    logger.debug("initialize() - start");

    if (_orderedTableNameMap != null) {
      logger.debug("The table name map has already been initialized.");
      // already initialized
      return;
    }

    // Gather all tables in the OrderedTableNameMap which also makes the duplicate check
    _orderedTableNameMap = this.createTableNameMap();
    ITableIterator iterator = createIterator(false);
    while (iterator.next()) {
      ITable table = iterator.getTable();
      _orderedTableNameMap.add(table.getTableMetaData().getTableName(), table);
    }
  }