package net.roseindia.service;

import java.util.List;
import net.roseindia.dao.ArticleDao;
import net.roseindia.model.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("articleService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class ArticleServiceImpl implements ArticleService {

	@Autowired
	private ArticleDao articleDao;

	public ArticleServiceImpl() {
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public List<Article> listArticles() {
		return articleDao.listArticles();
	}
	
	public List<Article> getArticleByArticleId(Long articleId){
		   return articleDao.getArticleByArticleId(articleId);
	}
	

}