public int compareTo(LegalDetails legalDetails) {
    long primaryKey = legalDetails.getPrimaryKey();

    if (getPrimaryKey() < primaryKey) {
      return -1;
    } else if (getPrimaryKey() > primaryKey) {
      return 1;
    } else {
      return 0;
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }

    LegalDetails legalDetails = null;

    try {
      legalDetails = (LegalDetails) obj;
    } catch (ClassCastException cce) {
      return false;
    }

    long primaryKey = legalDetails.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }
  /**
   * Converts the soap model instance into a normal model instance.
   *
   * @param soapModel the soap model instance to convert
   * @return the normal model instance
   */
  public static LegalDetails toModel(LegalDetailsSoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    LegalDetails model = new LegalDetailsImpl();

    model.setLegalDetailsId(soapModel.getLegalDetailsId());
    model.setCompanyId(soapModel.getCompanyId());
    model.setUserId(soapModel.getUserId());
    model.setCreateDate(soapModel.getCreateDate());
    model.setModifiedDate(soapModel.getModifiedDate());
    model.setName(soapModel.getName());
    model.setValueAddedTaxNo(soapModel.getValueAddedTaxNo());
    model.setRegistrationCourt(soapModel.getRegistrationCourt());
    model.setLegalForm(soapModel.getLegalForm());
    model.setAddress(soapModel.getAddress());
    model.setTelephone(soapModel.getTelephone());
    model.setEmail(soapModel.getEmail());
    model.setURL(soapModel.getURL());
    model.setFax(soapModel.getFax());

    return model;
  }