/** * @param all * @return */ private List<JobReportData> getJobReportData(List<JobInstance> all) { Set<Integer> workloadIds = new HashSet<Integer>(); for (JobInstance job : all) { workloadIds.add(job.getWorkloadId()); } List<Workload> workloads = workloadIds.isEmpty() ? new ArrayList<Workload>() : new WorkloadDao().findForIds(new ArrayList<Integer>(workloadIds)); Map<Integer, Project> projectMap = new HashMap<Integer, Project>(); for (Workload w : workloads) { projectMap.put(w.getId(), w.getProject()); } List<JobReportData> ret = new ArrayList<JobReportData>(); for (JobInstance job : all) { Project p = projectMap.get(job.getWorkloadId()); String name = p != null ? p.getName() : "N/A (Project Deleted)"; ret.add(new JobReportData(name, job)); } return ret; }
public String getModified() { return DateFormatUtils.format(project.getModified(), "dd/MM/yy HH:mm"); }