/** * Re-attach {@link TaskSource} */ private void reattachTaskSource() { TaskSource taskSource = task.getTaskSource(); taskSourceDAO.reattach(taskSource); Set<HoursGroup> hoursGroups = taskSource.getHoursGroups(); for (HoursGroup hoursGroup : hoursGroups) { reattachHoursGroup(hoursGroup); } }
@Override @Transactional(readOnly = true) public List<AggregatedHoursGroup> getHoursAggregatedByCriteria() { reattachTaskSource(); List<AggregatedHoursGroup> result = task.getTaskSource() .getAggregatedByCriterions(); ensuringAccesedPropertiesAreLoaded(result); return result; }