码迷,mamicode.com
首页 > 编程语言 > 详细

Spring注解实例

时间:2015-04-28 08:14:53      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

public class ActivityAction extends CoreAction {
	
	private static final Logger log = Logger.getLogger(ActivityAction.class);
	
	@Autowired
	private ActivityMng activityMng;

  

@Service
@Transactional
public class ActivityMngImpl extends CoreManagerImpl<Activity> implements ActivityMng{
	@Autowired
	public void setDao(ActivityDao dao) {
		super.setDao(dao);
	}

	public ActivityDao getDao() {
		return (ActivityDao) super.getDao();
	}

	public Activity findByName(String name) {
		return getDao().findByName(name);
	}

  

import org.springframework.stereotype.Repository;

import com.leadtone.ssh2.core.CoreDaoImpl;
import com.wangzhongsoft.fanliwang.activity.activity.dao.ActivityDao;
import com.wangzhongsoft.fanliwang.activity.activity.entity.Activity;
@Repository
public class ActivityDaoImpl extends CoreDaoImpl<Activity> implements ActivityDao {

	public Activity findByName(String name) {
		String hql="from Activity a where a.name like ‘%"+name+"%‘";
		return (Activity) findUnique(hql);
	}

}

  

Spring注解实例

标签:

原文地址:http://www.cnblogs.com/shaohz2014/p/4461944.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!