private Coach convertCoach(CoachData coachData) { Coach coach = new Coach(); coach.setName(coachData.getName()); coach.setMail(coachData.getEmail()); coach.setTel(coachData.getPhoneNumber()); return coach; }
@Override public void updateClub(ClubData clubData) { Club club = findClub(clubData.getAcronym()); club.setName(clubData.getName()); Coach coach = club.getCoach(); coach.setName(clubData.getCoach().getName()); coach.setMail(clubData.getCoach().getEmail()); coach.setTel(clubData.getCoach().getPhoneNumber()); clubRepository.save(club); }