#62 fix remove deadline in other JPA operation
This commit is contained in:
parent
9711febefb
commit
34499abd60
@ -60,6 +60,7 @@ public class ConferenceService {
|
|||||||
public Integer update(ConferenceDto conferenceDto) throws IOException {
|
public Integer update(ConferenceDto conferenceDto) throws IOException {
|
||||||
Conference conference = conferenceRepository.findOne(conferenceDto.getId());
|
Conference conference = conferenceRepository.findOne(conferenceDto.getId());
|
||||||
conferenceRepository.save(copyFromDto(conference, conferenceDto));
|
conferenceRepository.save(copyFromDto(conference, conferenceDto));
|
||||||
|
conferenceDto.getRemovedDeadlineIds().forEach(deadlineService::remove);
|
||||||
return conference.getId();
|
return conference.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,8 +75,6 @@ public class ConferenceService {
|
|||||||
conference.setPing(0);
|
conference.setPing(0);
|
||||||
conference.setBeginDate(conferenceDto.getBeginDate());
|
conference.setBeginDate(conferenceDto.getBeginDate());
|
||||||
conference.setEndDate(conferenceDto.getEndDate());
|
conference.setEndDate(conferenceDto.getEndDate());
|
||||||
conferenceDto.getRemovedDeadlineIds()
|
|
||||||
.forEach(deadlineService::remove);
|
|
||||||
conference.setDeadlines(deadlineService.saveOrCreate(conferenceDto.getDeadlines()));
|
conference.setDeadlines(deadlineService.saveOrCreate(conferenceDto.getDeadlines()));
|
||||||
return conference;
|
return conference;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,5 @@ public class DeadlineService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void remove(Integer deadlineId) {
|
public void remove(Integer deadlineId) {
|
||||||
deadlineRepository.delete(deadlineId);
|
deadlineRepository.delete(deadlineId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user