/** * This method persists in the database the list of statistics given in argument * * @param session The hibernate session * @param statsListDto The list of statistics to persist in the database * @throws JrafEnterpriseException exception occurs the saveAll work */ public static void saveAll(ISession session, List<SharedRepoStatsDTO> statsListDto) throws JrafEnterpriseException { try { SharedRepoStatsDAOImpl sharedRepoDao = SharedRepoStatsDAOImpl.getInstance(); SegmentationDAOImpl segmentationDao = SegmentationDAOImpl.getInstance(); for (SharedRepoStatsDTO sharedRepoStatsDto : statsListDto) { SharedRepoStatsBO statsBo = SharedRepoStatsTransform.dto2bo(sharedRepoStatsDto); SegmentationBO segment = (SegmentationBO) segmentationDao.get(session, statsBo.getSegmentation().getSegmentationId()); segment.getStatsList().add(statsBo); statsBo.setSegmentation(segment); sharedRepoDao.save(session, statsBo); } } catch (JrafDaoException e) { FacadeHelper.convertException(e, "saveAll"); } }