public PartStatistics retrieveEntryStatistics(String userId, long entryId) { Entry entry = dao.get(entryId); if (entry == null) return null; authorization.expectRead(userId, entry); PartStatistics statistics = new PartStatistics(); statistics.setEntryId(entryId); statistics.setCommentCount(commentDAO.getCommentCount(entry)); int traceSequenceCount = DAOFactory.getTraceSequenceDAO().getTraceSequenceCount(entry); statistics.setTraceSequenceCount(traceSequenceCount); int sampleCount = DAOFactory.getSampleDAO().getSampleCount(entry); statistics.setSampleCount(sampleCount); int historyCount = DAOFactory.getAuditDAO().getHistoryCount(entry); statistics.setHistoryCount(historyCount); int eddCount = DAOFactory.getExperimentDAO().getExperimentCount(entryId); statistics.setExperimentalDataCount(eddCount); return statistics; }