if ((element = lookupCache(cacheManager).get(DbUtils.hashCodeCacheKeyFor(id))) != null) {
log.debug("Cache hit on map for ProjectOverview " + id);
return (ProjectOverview)element.getObjectValue();
}
}
ProjectOverview overview = new ProjectOverview();
try {
Project p = lazyGet(rs.getLong("project_projectId"));
overview.setProject(p);
overview.setOverviewId(id);
overview.setPrincipalInvestigator(rs.getString("principalInvestigator"));
overview.setStartDate(rs.getDate("startDate"));
overview.setEndDate(rs.getDate("endDate"));
overview.setNumProposedSamples(rs.getInt("numProposedSamples"));
overview.setLocked(rs.getBoolean("locked"));
overview.setAllSampleQcPassed(rs.getBoolean("allSampleQcPassed"));
overview.setLibraryPreparationComplete(rs.getBoolean("libraryPreparationComplete"));
overview.setAllLibrariesQcPassed(rs.getBoolean("allLibraryQcPassed"));
overview.setAllPoolsConstructed(rs.getBoolean("allPoolsConstructed"));
overview.setAllRunsCompleted(rs.getBoolean("allRunsCompleted"));
overview.setPrimaryAnalysisCompleted(rs.getBoolean("primaryAnalysisCompleted"));
overview.setLastUpdated(rs.getTimestamp("lastUpdated"));
overview.setSamples(p.getSamples());
overview.setLibraries(libraryDAO.listByProjectId(rs.getLong("project_projectId")));
overview.setRuns(runDAO.listByProjectId(rs.getLong("project_projectId")));
overview.setNotes(noteDAO.listByProjectOverview(id));
overview.setWatchers(new HashSet<User>(watcherDAO.getWatchersByEntityName(overview.getWatchableIdentifier())));
if (overview.getProject().getSecurityProfile() != null &&
overview.getProject().getSecurityProfile().getOwner() != null)
overview.addWatcher(overview.getProject().getSecurityProfile().getOwner());
for (User u : watcherDAO.getWatchersByWatcherGroup("ProjectWatchers")) {
overview.addWatcher(u);
}
}
catch (IOException e) {
e.printStackTrace();
}