spring注解: @componet 、@Repository、@Service 和 @Controller
来源:互联网 发布:pdf可以转成ppt吗 知乎 编辑:程序博客网 时间:2024/06/05 14:35
1、@Service用于标注业务层组件
如:
@Service(value="aclService" )
@Transactional
public class AclServiceImpl implements AclService {
}
2、@Controller用于标注控制层组件(如struts中的action)
3、@Repository用于标注数据访问组件,即DAO组件
如:
@Repository
public class AclDaoImpl extends HibernateBaseDao<Acl, Integer> implements AclDao{
}
4、 @Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注
5、注入式(注解)@Autowired
@Service(value="aclService" )
@Transactional
public class AclServiceImpl implements AclService {
private static final Logger logger=Logger.getLogger(AclServiceImpl. class);
/**
* Acl的dao 层对象
*/
@Autowired
private AclDao dao = null;
}
6、事务@Transactional
- spring注解: @componet 、@Repository、@Service 和 @Controller
- Spring注解@Repository、@Service、@Controller 和 @Component
- Spring 注解(@Repository 、@Service 和 @Controller )
- Spring注解@Repository、@Service、@Controller
- spring注解:@Repository、@Service、@Controller
- Spring注解的使用和区别:@Component、@Service、@Repository、@Controller
- Spring注解的使用和区别:@Component、@Service、@Repository、@Controller
- Spring @Repository、@Service、@Controller 和 @Component 注解作用
- Spring注解@Component、@Repository、@Service、@Controller区别
- Spring注解@Component、@Repository、@Service、@Controller区别
- Spring 注解@Component,@Service,@Controller,@Repository
- Spring 注解@Component,@Service,@Controller,@Repository
- Spring注解@Component、@Repository、@Service、@Controller区别
- Spring注解@Component、@Repository、@Service、@Controller区别
- Spring注解@Component、@Repository、@Service、@Controller区别
- Spring注解@Component、@Repository、@Service、@Controller区别
- Spring注解@Componen、@Repository@Service、@Controller区别
- Spring注解@Component、@Repository、@Service、@Controller
- 《javascript 高级程序设计》笔记
- 尾递归小叙
- 声明变量
- spring版本兼容问题
- UBOOT 通过 TFTP 下载 uImage
- spring注解: @componet 、@Repository、@Service 和 @Controller
- 利用GridView控件实现分页效果
- GIS中空间分析中的八个问题
- dedecms织梦网
- hdu 2570 迷瘴
- 谈谈Dictionary和List的问题
- cocos2d-x 心得
- JAVA国际化
- hdu 1395 2^x mod n = 1给定n值 求x