ItEr36S07ValidacionEProbasFuncionaisItEr35S08: [Bug #100] Avoiding LazyInitializationException ensuring that the AggregatedHours' properties being shown are already loaded.
This commit is contained in:
parent
ea9b5b8cbe
commit
c99c0b0aca
1 changed files with 15 additions and 1 deletions
|
|
@ -265,8 +265,22 @@ public class ResourceAllocationModel implements IResourceAllocationModel {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<AggregatedHoursGroup> getHoursAggregatedByCriterions() {
|
||||
return task.getAggregatedByCriterions();
|
||||
TaskSource taskSource = task.getTaskSource();
|
||||
taskSourceDAO.reattach(taskSource);
|
||||
List<AggregatedHoursGroup> result = taskSource
|
||||
.getAggregatedByCriterions();
|
||||
ensuringAccesedPropertiesAreLoaded(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void ensuringAccesedPropertiesAreLoaded(
|
||||
List<AggregatedHoursGroup> result) {
|
||||
for (AggregatedHoursGroup each : result) {
|
||||
each.getCriterionsJoinedByComma();
|
||||
each.getHours();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue