Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. package com.marchenko.news;
  2.  
  3. import com.marchenko.news.dao.interfaces.NewsDao;
  4. import com.marchenko.news.entity.News;
  5. import com.marchenko.news.exception.DaoException;
  6. import org.springframework.context.ApplicationContext;
  7. import org.springframework.context.support.ClassPathXmlApplicationContext;
  8.  
  9. import java.util.List;
  10.  
  11. /**
  12. * Created by Marchenko Vadim on 4/29/2016.
  13. */
  14. public class Main {
  15. public static void main(String[] args) throws DaoException {
  16. ApplicationContext context =
  17. new ClassPathXmlApplicationContext("spring.xml");
  18. NewsDao newsDao = (NewsDao) context.getBean("newsDao");
  19. List<News> newses = newsDao.takeMostCommentedNews(1L, 3L);
  20. for(News news : newses){
  21. System.out.println(news);
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement