ItEr40S21ImplantacionAplicacionItEr33S10: [Bug #205] Fixing bug. Marking all resource allocations after being saved as not transient.
This commit is contained in:
parent
ea5751465d
commit
f3cec68358
1 changed files with 9 additions and 6 deletions
|
|
@ -125,10 +125,10 @@ public class SaveCommand implements ISaveCommand {
|
|||
private void saveTasksToSave() {
|
||||
for (TaskElement taskElement : state.getTasksToSave()) {
|
||||
taskElementDAO.save(taskElement);
|
||||
dontPoseAsTransient(taskElement);
|
||||
if (taskElement instanceof Task) {
|
||||
saveTask(taskElement, (Task) taskElement);
|
||||
}
|
||||
dontPoseAsTransient(taskElement);
|
||||
}
|
||||
if (!state.getTasksToSave().isEmpty()) {
|
||||
updateRootTaskPosition();
|
||||
|
|
@ -142,7 +142,7 @@ public class SaveCommand implements ISaveCommand {
|
|||
taskElement.dontPoseAsTransientObjectAnymore();
|
||||
}
|
||||
Set<ResourceAllocation<?>> resourceAllocations = taskElement.getResourceAllocations();
|
||||
derivedDontPoseAsTransient(resourceAllocations);
|
||||
dontPoseAsTransient(resourceAllocations);
|
||||
if (!taskElement.isLeaf()) {
|
||||
for (TaskElement each : taskElement.getChildren()) {
|
||||
dontPoseAsTransient(each);
|
||||
|
|
@ -150,14 +150,17 @@ public class SaveCommand implements ISaveCommand {
|
|||
}
|
||||
}
|
||||
|
||||
private void derivedDontPoseAsTransient(
|
||||
private void dontPoseAsTransient(
|
||||
Set<ResourceAllocation<?>> resourceAllocations) {
|
||||
for (ResourceAllocation<?> each : resourceAllocations) {
|
||||
each.dontPoseAsTransientObjectAnymore();
|
||||
for (DayAssignment eachAssignment : each.getAssignments()) {
|
||||
eachAssignment.dontPoseAsTransientObjectAnymore();
|
||||
}
|
||||
for (DerivedAllocation eachDerived : each.getDerivedAllocations()) {
|
||||
eachDerived.dontPoseAsTransientObjectAnymore();
|
||||
List<DerivedDayAssignment> assignments = eachDerived
|
||||
.getAssignments();
|
||||
for (DerivedDayAssignment eachAssignment : assignments) {
|
||||
for (DerivedDayAssignment eachAssignment : eachDerived
|
||||
.getAssignments()) {
|
||||
eachAssignment.dontPoseAsTransientObjectAnymore();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue