List<OrderCostsPerResourceDTO> list = query.list();
List<OrderCostsPerResourceDTO> filteredList = new ArrayList<OrderCostsPerResourceDTO>();
for (OrderCostsPerResourceDTO each : list) {
Order order = loadOrderAvoidingProxyFor(each.getOrderElement());
// Apply filtering
if (matchFilterCriterion(each.getOrderElement(), criterions)
&& isOrderContained(order, orders)) {
// Attach ordername value
each.setOrderName(order.getName());
each.setOrderCode(order.getCode());
// Attach calculated pricePerHour
BigDecimal pricePerHour = CostCategoryDAO
.getPriceByResourceDateAndHourType(each.getWorker(),
new LocalDate(each.getDate()), each
.getHoursTypeCode());