issue-77 #105

Merged
sebastian merged 17 commits from issue-77 into master 2024-03-16 10:12:35 +01:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit e102b91a1f - Show all commits

View File

@ -10,11 +10,11 @@ public class TaskSerieItem {
@GeneratedValue(strategy = GenerationType.AUTO)
private long itemID;
@ManyToOne()
@ManyToOne
@JoinColumn(referencedColumnName = "taskSerieID")
private TaskSerie taskSerie;
@OneToOne
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "task_id")
private Task task;

View File

@ -69,7 +69,7 @@ public class TaskSeriesService {
TaskSerie taskSerie = task.getTaskSerieItem().getTaskSerie();
task.setTaskSerieItem(null);
taskSerieItemRepository.delete(item);
if(taskSerie.getTasks().size() == 1) {
if(taskSerie.getTasks().size() <= 1) {
taskSeriesRepository.delete(taskSerie);
}
}