issue-77 #105
@ -10,11 +10,11 @@ public class TaskSerieItem {
|
|||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long itemID;
|
private long itemID;
|
||||||
|
|
||||||
@ManyToOne()
|
@ManyToOne
|
||||||
@JoinColumn(referencedColumnName = "taskSerieID")
|
@JoinColumn(referencedColumnName = "taskSerieID")
|
||||||
private TaskSerie taskSerie;
|
private TaskSerie taskSerie;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "task_id")
|
@JoinColumn(name = "task_id")
|
||||||
private Task task;
|
private Task task;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public class TaskSeriesService {
|
|||||||
TaskSerie taskSerie = task.getTaskSerieItem().getTaskSerie();
|
TaskSerie taskSerie = task.getTaskSerieItem().getTaskSerie();
|
||||||
task.setTaskSerieItem(null);
|
task.setTaskSerieItem(null);
|
||||||
taskSerieItemRepository.delete(item);
|
taskSerieItemRepository.delete(item);
|
||||||
if(taskSerie.getTasks().size() == 1) {
|
if(taskSerie.getTasks().size() <= 1) {
|
||||||
taskSeriesRepository.delete(taskSerie);
|
taskSeriesRepository.delete(taskSerie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user