@@ -0,0 +1,2264 @@
+package uk.ac.ebi.spot.goci.curation.service;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.scheduling.annotation.Async;%0Aimport org.springframework.scheduling.annotation.AsyncResult;%0Aimport org.springframework.stereotype.Service;%0Aimport uk.ac.ebi.spot.goci.curation.model.SnpAssociationTableView;%0Aimport uk.ac.ebi.spot.goci.model.Association;%0Aimport uk.ac.ebi.spot.goci.model.Study;%0Aimport uk.ac.ebi.spot.goci.repository.AssociationRepository;%0Aimport uk.ac.ebi.spot.goci.repository.StudyRepository;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.concurrent.Future;%0A%0A/**%0A * Created by emma on 06/06/2016.%0A *%0A * @author emma%0A *         %3Cp%3E%0A *         Service to create a printable view of all study details%0A */%0A@Service%0Apublic class StudyPrintService %7B%0A%0A    private StudyRepository studyRepository;%0A    private AssociationRepository associationRepository;%0A    private AssociationViewService associationViewService;%0A%0A    @Autowired%0A    public StudyPrintService(StudyRepository studyRepository,%0A                             AssociationRepository associationRepository,%0A                             AssociationViewService associationViewService) %7B%0A        this.studyRepository = studyRepository;%0A        this.associationRepository = associationRepository;%0A        this.associationViewService = associationViewService;%0A    %7D%0A%0A    public Collection%3CSnpAssociationTableView%3E generatePrintView(Long studyId) %7B%0A        // Get relevant study details%0A        Study studyToView = studyRepository.findOne(studyId);%0A%0A        // Association information%0A        Collection%3CAssociation%3E associations = new ArrayList%3C%3E();%0A        associations.addAll(associationRepository.findByStudyId(studyId));%0A%0A        // For our associations create a table view object and return%0A        Collection%3CSnpAssociationTableView%3E snpAssociationTableViews = new ArrayList%3CSnpAssociationTableView%3E();%0A        for (Association association : associations) %7B%0A            SnpAssociationTableView snpAssociationTableView =%0A                    associationViewService.createSnpAssociationTableView(association);%0A            snpAssociationTableViews.add(snpAssociationTableView);%0A        %7D%0A        return snpAssociationTableViews;%0A    %7D%0A%7D

Move the association view creation to this service rather that controller