public List<ScienceProjectVo> loadAllScienceProjectsSponsoredBy(int sponsorID) {
SeteUser sponsor = userDao.findById(sponsorID);
List<ScienceProject> projects = projectDao.findSponsoredBy(sponsor);
List<ScienceProjectVo> projectVos = new ArrayList<ScienceProjectVo>();
ScienceProjectVo vo = null;
List<String> students = null;
if(projects == null || projects.isEmpty()){
return projectVos;
}
for(ScienceProject sp : projects) {
vo = new ScienceProjectVo();
students = new ArrayList<String>();
vo.setId(sp.getId());
vo.setName(sp.getName());
vo.setDescription(sp.getDescription());
vo.setExhibitId(sp.getExhibitIdentifier());
vo.setCategory(sp.getScienceProjectCategoryType().getLabel());
for(SeteUser u : sp.getStudents()) {
students.add(u.getFirstName() + " " + u.getLastName());
}
vo.setStudents(students);
projectVos.add(vo);
}
return projectVos;