net.roseindia.service

This section contains the service interface and its implementation class.

Ads

net.roseindia.service

This section contains the service interface and its implementation class.

ArticleService.java

package net.roseindia.service;

import java.util.List;

import net.roseindia.model.Article;

public interface ArticleService {

	public void addArticle(Article article);

	public List<Article> listArticles();
}

ArticleServiceImpl.java

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 void addArticle(Article article) {
	articleDao.saveArticle(article);
	}
	
	public List<Article> listArticles() {
	return articleDao.listArticles();
	}

}

 

Advertisements

Share on Google+Share on Google+

net.roseindia.service

Posted on: March 28, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: net.roseindia.service  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads