private UserPaymentMapper mapper = new UserPaymentMapper();
@Transactional
public UserPaymentUI create(UserPaymentUI uiBean) {
UserPayment newUserPayment = mapper.toPersistenceBean(uiBean);
if (uiBean.getUserName() == null) {
return null;
}
User user = userRepository.findByUsername(uiBean.getUserName());
newUserPayment.setUser(user);
UserPayment saved = repository.save(newUserPayment);
logger.debug("Added Payment : " + saved);
return mapper.toUIBean(saved);
}