public UserPaymentUI update(UserPaymentUI uiBean) { UserPayment existing = repository.findById(uiBean.getId()); if (existing == null) { return null; } existing.setAmount(uiBean.getAmount()); existing.setNotes(uiBean.getNotes()); UserPayment saved = null; try { saved = repository.save(existing); } catch (Exception e) { logger.error(e); } return mapper.toUIBean(saved); }