addIfNotNull(minDates, minMax.getFirst());
addIfNotNull(maxDates, minMax.getSecond());
for (OrderElement child : orderElement.getChildren()) {
SumChargedEffort childSumChargedEffort = getByOrderElement(child);
addIfNotNull(minDates,
childSumChargedEffort.getFirstTimesheetDate());
addIfNotNull(maxDates, childSumChargedEffort.getLastTimesheetDate());
}
Pair<Date, Date> result = Pair.create(minDates.isEmpty() ? null
: Collections.min(minDates), maxDates.isEmpty() ? null
: Collections.max(maxDates));
SumChargedEffort sumChargedEffort = getByOrderElement(orderElement);
sumChargedEffort.setTimesheetDates(result.getFirst(),
result.getSecond());
save(sumChargedEffort);
}