public Long deleteMeetingMember(Long meetingMemberId) { log.debug("MeetingMemnerDAoImpl.deleteMeetingMember : " + meetingMemberId); try { MeetingMember gm = this.getMeetingMemberById(meetingMemberId); log.debug("ac: " + gm); if (gm == null) { log.debug("Already deleted / Could not find: " + meetingMemberId); return null; } gm.setUpdatetime(new Date()); gm.setDeleted(true); if (gm.getMeetingMemberId() == null) { em.persist(gm); } else { if (!em.contains(gm)) { em.merge(gm); } } return meetingMemberId; } catch (Exception ex2) { log.error("[deleteMeetingMember]: ", ex2); } return null; }
public Long updateMeetingMember( Long meetingMemberId, String firstname, String lastname, String memberStatus, String appointmentStatus, Long appointmentId, Long userid, String email, String phone) { try { MeetingMember gm = this.getMeetingMemberById(meetingMemberId); /* * if (gm == null) { log.debug("ALERT Object with ID: "+ * MeetingMemberId +" does not exist yet"); return null; } */ gm.setFirstname(firstname); gm.setLastname(lastname); // gm.setLanguageId(Languagemanagement.getInstance().getFieldLanguageById(languageId)); gm.setMemberStatus(memberStatus); gm.setAppointmentStatus(appointmentStatus); gm.setAppointment(appointmentDao.getAppointmentById(appointmentId)); gm.setDeleted(false); gm.setUpdatetime(new Date()); gm.setUserid(usersDao.get(userid)); gm.setEmail(email); gm.setPhone(phone); if (gm.getMeetingMemberId() == null) { em.persist(gm); } else { if (!em.contains(gm)) { gm = em.merge(gm); } } meetingMemberId = gm.getMeetingMemberId(); return meetingMemberId; } catch (Exception ex2) { log.error("[updateMeetingMember]: ", ex2); } return null; }