issue-77 #105
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user