Spring注解实例

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);
} }

  

上一篇:Android studio导入eclipse项目遇到的错误解决方案


下一篇:centos 7 nginx 安装