Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.marchenko.news;
- import com.marchenko.news.dao.interfaces.NewsDao;
- import com.marchenko.news.entity.News;
- import com.marchenko.news.exception.DaoException;
- import org.springframework.context.ApplicationContext;
- import org.springframework.context.support.ClassPathXmlApplicationContext;
- import java.util.List;
- /**
- * Created by Marchenko Vadim on 4/29/2016.
- */
- public class Main {
- public static void main(String[] args) throws DaoException {
- ApplicationContext context =
- new ClassPathXmlApplicationContext("spring.xml");
- NewsDao newsDao = (NewsDao) context.getBean("newsDao");
- List<News> newses = newsDao.takeMostCommentedNews(1L, 3L);
- for(News news : newses){
- System.out.println(news);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement