コード例 #1
0
  /**
   * get descriptions of all tables in the database
   *
   * @return set of descriptions, where each descriptions - is a list that contains name of the
   *     table at 0 index, and column names. Key name has 1 index in list.
   */
  public Map<String, TableDescription> getTablesInDataBaseDescription() {
    Map<String, TableDescription> result = new HashMap<String, TableDescription>();

    for (DataBase db : databases.values()) {
      for (TableDescription td : db.getTablesDescriptions()) {
        String tableName = td.getName();
        if (!result.containsKey(tableName)) {
          result.put(tableName, td);
        }
      }
    }
    return result;
  }
コード例 #2
0
 /**
  * create table with given description
  *
  * @param tableDescription - given description
  * @return true - if database modified
  * @throws DataBaseTableException - if something wrong
  */
 public boolean createTable(TableDescription tableDescription) throws DataBaseTableException {
   String tableName = tableDescription.getName();
   List<String> columnNames = tableDescription.getColumnNames();
   return createTable(tableName, columnNames);
 }