微服务 教程
1085个小节阅读:196.7k
目录
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
作用:这三个注解和@Component的作用一样,使用它们是为了区分该类属于什么层。
位置:
xxxxxxxxxx
@Repository
public class StudentDaoImpl implements StudentDao{}
@Service
public class StudentService {}
作用:指定bean的创建策略
位置:类上方
取值:singleton prototype request session globalsession
xxxxxxxxxx
@Service
@Scope("singleton")
public class StudentService {}
1. 在spring中,@Repository
一般写在的类上
A 控制层
B 服务层
C 持久层
D 实体层
2. 在Spring中, @Scope
的作用是
A 注入对象类型的属性值
B 注入String类型和基本数据类型的属性值
C 将对象放入Spring容器
D 指定bean的创建策略
1=>C 2=>D