首页 > 编程语言 > 详细

Spring注解实例

时间:2015-04-28 08:12:59      阅读:296      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!