@Test public void testExecuteSuccess() { Set<TutorialVideoDTO> tutorialVideos = sut.execute(null); assertEquals(3, tutorialVideos.size()); for (TutorialVideoDTO tut : tutorialVideos) { assertEquals(Page.START, tut.getPage()); } }
@SuppressWarnings("unchecked") @Override public Set<TutorialVideoDTO> execute(final Long inRequest) { Criteria criteria = getHibernateSession().createCriteria(TutorialVideo.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("page")); fields.add(getColumn("dialogTitle")); fields.add(getColumn("innerContentTitle")); fields.add(getColumn("innerContent")); fields.add(getColumn("videoUrl")); fields.add(getColumn("videoWidth")); fields.add(getColumn("videoHeight")); criteria.setProjection(fields); ModelViewResultTransformer<TutorialVideoDTO> resultTransformer = new ModelViewResultTransformer<TutorialVideoDTO>(new TutorialVideoDTOFactory()); criteria.setResultTransformer(resultTransformer); List<TutorialVideoDTO> tutorialVideoSet = criteria.list(); return new HashSet<TutorialVideoDTO>(tutorialVideoSet); }
GetTutorialVideosDbMapper extends BaseArgDomainMapper<Long, Set<TutorialVideoDTO>> { @SuppressWarnings("unchecked") @Override public Set<TutorialVideoDTO> execute(final Long inRequest) { Criteria criteria = getHibernateSession().createCriteria(TutorialVideo.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("page")); fields.add(getColumn("dialogTitle")); fields.add(getColumn("innerContentTitle")); fields.add(getColumn("innerContent")); fields.add(getColumn("videoUrl")); fields.add(getColumn("videoWidth")); fields.add(getColumn("videoHeight")); criteria.setProjection(fields); ModelViewResultTransformer<TutorialVideoDTO> resultTransformer = new ModelViewResultTransformer<TutorialVideoDTO>(new TutorialVideoDTOFactory()); criteria.setResultTransformer(resultTransformer); List<TutorialVideoDTO> tutorialVideoSet = criteria.list(); return new HashSet<TutorialVideoDTO>(tutorialVideoSet); } }
GetTutorialVideosDbMapper extends BaseArgDomainMapper<Long, Set<TutorialVideoDTO>> { @SuppressWarnings("unchecked") @Override public Set<TutorialVideoDTO> execute(final Long inRequest) { Criteria criteria = getHibernateSession().createCriteria(TutorialVideo.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("page")); fields.add(getColumn("dialogTitle")); fields.add(getColumn("innerContentTitle")); fields.add(getColumn("innerContent")); fields.add(getColumn("videoUrl")); fields.add(getColumn("videoWidth")); fields.add(getColumn("videoHeight")); criteria.setProjection(fields); ModelViewResultTransformer<TutorialVideoDTO> resultTransformer = new ModelViewResultTransformer<TutorialVideoDTO>(new TutorialVideoDTOFactory()); criteria.setResultTransformer(resultTransformer); List<TutorialVideoDTO> tutorialVideoSet = criteria.list(); return new HashSet<TutorialVideoDTO>(tutorialVideoSet); }  }
GetTutorialVideosDbMapper extends BaseArgDomainMapper<Long, Set<TutorialVideoDTO>> { @SuppressWarnings("unchecked") @Override public Set<TutorialVideoDTO> execute(final Long inRequest) { Criteria criteria = getHibernateSession().createCriteria(TutorialVideo.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("page")); fields.add(getColumn("dialogTitle")); fields.add(getColumn("innerContentTitle")); fields.add(getColumn("innerContent")); fields.add(getColumn("videoUrl")); fields.add(getColumn("videoWidth")); fields.add(getColumn("videoHeight")); criteria.setProjection(fields); ModelViewResultTransformer<TutorialVideoDTO> resultTransformer = new ModelViewResultTransformer<TutorialVideoDTO>(new TutorialVideoDTOFactory()); criteria.setResultTransformer(resultTransformer); List<TutorialVideoDTO> tutorialVideoSet = criteria.list(); return new HashSet<TutorialVideoDTO>(tutorialVideoSet); }  @SuppressWarnings("unchecked") @Override Set<TutorialVideoDTO> execute(final Long inRequest); }
GetTutorialVideosDbMapper extends BaseArgDomainMapper<Long, Set<TutorialVideoDTO>> { @SuppressWarnings("unchecked") @Override public Set<TutorialVideoDTO> execute(final Long inRequest) { Criteria criteria = getHibernateSession().createCriteria(TutorialVideo.class); ProjectionList fields = Projections.projectionList(); fields.add(getColumn("id")); fields.add(getColumn("page")); fields.add(getColumn("dialogTitle")); fields.add(getColumn("innerContentTitle")); fields.add(getColumn("innerContent")); fields.add(getColumn("videoUrl")); fields.add(getColumn("videoWidth")); fields.add(getColumn("videoHeight")); criteria.setProjection(fields); ModelViewResultTransformer<TutorialVideoDTO> resultTransformer = new ModelViewResultTransformer<TutorialVideoDTO>(new TutorialVideoDTOFactory()); criteria.setResultTransformer(resultTransformer); List<TutorialVideoDTO> tutorialVideoSet = criteria.list(); return new HashSet<TutorialVideoDTO>(tutorialVideoSet); }  @SuppressWarnings("unchecked") @Override Set<TutorialVideoDTO> execute(final Long inRequest);  }