ItEr19S08CUCreacionProxectoPlanificacionItEr18S08: a transient TaskElement could be removed from the interface, but you can't remove it in the database.
This commit is contained in:
parent
ce0a7a5c72
commit
d78738e11d
1 changed files with 12 additions and 1 deletions
|
|
@ -31,7 +31,18 @@ public class PlanningState {
|
|||
}
|
||||
|
||||
public Collection<? extends TaskElement> getToRemove() {
|
||||
return Collections.unmodifiableCollection(toRemove);
|
||||
return Collections.unmodifiableCollection(onlyNotTransient(toRemove));
|
||||
}
|
||||
|
||||
private List<TaskElement> onlyNotTransient(
|
||||
Collection<? extends TaskElement> toRemove) {
|
||||
ArrayList<TaskElement> result = new ArrayList<TaskElement>();
|
||||
for (TaskElement taskElement : toRemove) {
|
||||
if (taskElement.getId() != null) {
|
||||
result.add(taskElement);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void removed(TaskElement taskElement) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue