Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
MultiRoutingDataSource Test 코드
결과
2012-03-14 17:27:24 DEBUG [PROFILE:57] – +–>[SERVICE_S] UserReviewService.getTotalCountOfUserReview()
2012-03-14 17:27:24 DEBUG [PROFILE:77] – DataSource ===> DIST_READ
package kr.sidnancy.service.review.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import kr.sidnancy.common.annotation.DataSource;
import kr.sidnancy.common.type.DataSourceType;
import kr.sidnancy.condition.review.UserReviewCond;
import kr.sidnancy.entity.review.UserReview;
import kr.sidnancy.persistence.review.UserReviewMapper;
import kr.sidnancy.service.review.IUserReviewService;
/**
* @author sidnancy
*
*/
@Service
public class UserReviewService implements IUserReviewService {
@Autowired
private UserReviewMapper userReviewMapper;
@Override
@Transactional(readOnly=true)
@DataSource(DataSourceType.DIST_READ)
public List listUserReview(String userid) throws DataAccessException {
return userReviewMapper.listUserReview(userid);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment