示例#1
0
  @Transient
  public void removeCreditCard(CreditCard creditCard) {

    boolean originalValue = creditCard.isEnabled();

    try {
      creditCard.setEnabled(false);
      Dao.update(creditCard);
    } catch (HibernateException e) {
      creditCard.setEnabled(originalValue);
    }
  }
示例#2
0
  @Transient
  public void addCreditCard(CreditCard creditCard) {

    try {
      creditCard.setCustomer(this);
      creditCard.setEnabled(true);
      creditCards.add(creditCard);
      Dao.saveOrUpdate(creditCard);
    } catch (HibernateException e) {
      creditCard.setEnabled(false);
    }
  }