public boolean delete() throws PlatformException, DBException {
    SQLDelete delete = new SQLDelete();
    // deleting data set
    delete.setTable(TABLE_NAME);
    delete.addCondition("attributeset_id =", _attributeSetID);
    int rows;
    try {
      rows = _dbManager.delete(delete);
    } catch (SQLException e) {
      LOGGER.fatal("", e);
      throw new DBException("Cannot delete!", e);
    }

    LOGGER.debug("rows deleted: " + rows);
    return (rows > 0);
  }
  public int save() throws PlatformException, DBException {
    // removing old attribute set with the same name
    SQLDelete delete = new SQLDelete();
    delete.setTable(TABLE_NAME);
    delete.addCondition("attributeset_name = ", _name);
    int rows;
    try {
      rows = _dbManager.delete(delete);
    } catch (SQLException e) {
      LOGGER.fatal("!", e);
      throw new DBException("Cannot delete!", e);
    }
    LOGGER.debug("rows deleted: " + rows);

    // saving header
    SQLUpdate update = new SQLUpdate(TABLE_NAME);
    if (_name != null) {
      update.addValue("attributeset_name", _name);
    }
    if (_info != null) {
      update.addValue("attributeset_info", _info);
    }

    if (_attributeSetID == 0) {
      update.addValue("c_date", new Date(System.currentTimeMillis()));
    }

    update.addValue("solution_id", _solutionID);
    update.addValue("lm_date", new Date(System.currentTimeMillis()));

    try {
      _attributeSetID =
          _dbManager.insertOrUpdate(update, "attributeset_id", _attributeSetID, GEN_NAME);
    } catch (SQLException e) {
      LOGGER.fatal("Exception was thrown!", e);
      throw new DBException("Cannot save!", e);
    }

    try {
      // saving items
      for (IAttributeDescription description : _descriptions) {
        // FIXME: why it can be null???
        if (description != null) {
          SQLInsert insert = new SQLInsert(ITEMS_TABLE_NAME);
          insert.addValue("attributeset_id", _attributeSetID);
          insert.addValue("attribute_name", description.getName());
          insert.addValue("attribute_type", description.getType().getDBString());
          insert.addValue("table_name", description.getColumn().getTable().getName());
          insert.addValue("column_name", description.getColumn().getName());
          insert.addValue("is_output", description.isOutput() ? "Y" : "N");
          // FIXME: workaround!
          if (description instanceof EnumAttributeDescription) {
            insert.addValue(
                "attribute_value", ((EnumAttributeDescription) description).valuesToString());
          }

          LOGGER.debug("insert: " + insert.getQuery());
          _dbManager.insert(insert, "attributeset_item_id");
        }
      }
    } catch (SQLException e) {
      LOGGER.fatal("Exception was thrown!", e);
      throw new DBException("Cannot save!", e);
    }

    return _attributeSetID;
  }