@Override protected void updateFields(Schedule domain, Schedule newDomain) { domain.setDayOfWeek(newDomain.getDayOfWeek()); domain.setWeek(newDomain.getWeek()); domain.setClassroomId(newDomain.getClassroomId()); domain.setDisciplineTimeId(newDomain.getDisciplineTimeId()); domain.setStudyId(newDomain.getStudyId()); }
@Override protected void validate(Schedule domain) { try { DomainUtil.checkingForNotNull(domain.getWeek()); DomainUtil.checkingForNotNull(domain.getDayOfWeek()); DomainUtil.checkingForNotNull(domain.getStudyId()); DomainUtil.checkingForNotNull(domain.getClassroomId()); DomainUtil.checkingForNotNull(domain.getDisciplineTimeId()); } catch (NullPropertyException e) { throw new RestServiceException(Response.Status.BAD_REQUEST.getStatusCode()); } }