issue-113: Fix all Delete Operations #114

Merged
sebastian merged 4 commits from issue-113 into master 2024-04-17 20:25:39 +02:00
2 changed files with 1 additions and 8 deletions
Showing only changes of commit 79f1eba26b - Show all commits

View File

@ -15,9 +15,6 @@ public class TaskSerie {
@OneToMany(fetch = FetchType.EAGER, mappedBy = "taskSerie", orphanRemoval = true) @OneToMany(fetch = FetchType.EAGER, mappedBy = "taskSerie", orphanRemoval = true)
List<TaskSerieItem> tasks = new ArrayList<>(); List<TaskSerieItem> tasks = new ArrayList<>();
public long getTaskSerieID() { public long getTaskSerieID() {
return taskSerieID; return taskSerieID;
} }

View File

@ -135,11 +135,7 @@ public class TaskSeriesService {
task.setTaskSerieItem(null); task.setTaskSerieItem(null);
taskSerieItemRepository.delete(item); taskSerieItemRepository.delete(item);
if(taskSerie.getTasks().isEmpty()) { if(taskSerie.getTasks().isEmpty()) {
for(TaskSerieItem taskSerieItem : taskSerie.getTasks()) { taskSeriesRepository.deleteUnreferenced();
taskSerieItem.setTaskSerie(null);
}
taskSerie.getTasks().clear();
taskSeriesRepository.delete(taskSerie);
} else if(task.getParent() == null){ } else if(task.getParent() == null){
repearIndexing(taskSerie, item.getSeriesIndex()); repearIndexing(taskSerie, item.getSeriesIndex());
} }