/**
   * @see net.metaship.generic.Manager#deleteSpecialRate(PrimaryKey)
   * @ejb.interface-method
   * @ejb.transaction type="Required"
   */
  public void delete(PrimaryKey primaryKey) throws LocalException {
    checkPrimaryKeyInstance(primaryKey);

    try {
      Collection col =
          SpecialRateLineUtil.getLocalHome()
              .findBySpecialRateId(((SpecialRatePK) primaryKey).getId().longValue());
      for (Iterator iter = col.iterator(); iter.hasNext(); ) {
        SpecialRateLineLocal element = (SpecialRateLineLocal) iter.next();

        Collection col2 =
            RateServiceAreaUtil.getLocalHome().findBySpecialRateLineId(element.getId().longValue());
        for (Iterator iterator = col2.iterator(); iterator.hasNext(); ) {
          RateServiceAreaLocal element2 = (RateServiceAreaLocal) iterator.next();
          element2.remove();
        }

        element.remove();
      }

      SpecialRateLocalHome home = SpecialRateUtil.getLocalHome();
      SpecialRateLocal local = home.findByPrimaryKey((SpecialRatePK) primaryKey);
      local.remove();
    } catch (Exception e) {
      throw new LocalException(
          "An Error occured while deleting object with primary key: " + primaryKey + "!!", e);
    }
  }