ItEr60S04ValidacionEProbasFuncionaisItEr59S04: [Bug #526] Use the same objects.
It was not finding the allocations at the map because there were different instances for the same criterions on the db.
This commit is contained in:
parent
75da2dbba0
commit
6402032da2
1 changed files with 15 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ import org.navalplanner.business.planner.entities.ResourceAllocation;
|
|||
import org.navalplanner.business.planner.entities.SpecificResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.Task;
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.business.resources.daos.ICriterionDAO;
|
||||
import org.navalplanner.business.resources.daos.IResourceDAO;
|
||||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.CriterionSatisfaction;
|
||||
|
|
@ -86,6 +87,9 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
@Autowired
|
||||
private IOrderElementDAO orderElementDAO;
|
||||
|
||||
@Autowired
|
||||
private ICriterionDAO criterionDAO;
|
||||
|
||||
@Autowired
|
||||
private IOrderDAO orderDAO;
|
||||
|
||||
|
|
@ -222,7 +226,11 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
}
|
||||
|
||||
private Map<Criterion, List<GenericResourceAllocation>> genericAllocationsByCriterion() {
|
||||
if(!criteriaToShowList.isEmpty()) {
|
||||
if (!criteriaToShowList.isEmpty()) {
|
||||
reattachCriteriaToShow();
|
||||
// reattaching criterions so the query returns the same criteria as
|
||||
// keys
|
||||
allCriteriaList = new ArrayList<Criterion>(criteriaToShowList);
|
||||
return resourceAllocationDAO
|
||||
.findGenericAllocationsBySomeCriterion(criteriaToShowList, initDateFilter, endDateFilter);
|
||||
}
|
||||
|
|
@ -262,6 +270,12 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
return toReturnFiltered;
|
||||
}
|
||||
|
||||
private void reattachCriteriaToShow() {
|
||||
for (Criterion each : criteriaToShowList) {
|
||||
criterionDAO.reattachUnmodifiedEntity(each);
|
||||
}
|
||||
}
|
||||
|
||||
private List<Resource> resourcesToShow() {
|
||||
if(!resourcesToShowList.isEmpty()) {
|
||||
return getResourcesToShowReattached();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue