SpringBoot注解
SpringBoot注解
2@Autowiredspring提供3@Inject
2
2
3
2
3
4
4@RestControllercontroller层注解,相当于@ResponseBody和@Controller的组合注解5@Controllercontroller层注解6@ResponseBody返回json格式,与@Controller搭配使用7@RequestMapping请求路径限制8@RequestParam读取请求参数9
3@Param
4
四、表的映射1@Entity实体类注解2@Table表名3@Id表中的id4@Transient
一、声明bean注解
1@Component通用注解2@Controller表现层3@Service业务逻辑层4@Repository数据访问层(dao层)5@RestController表现层,@Controller+@ResponseBody二、注入bean注解
1@Resource2@Autowiredspring提供3@Inject
三、bean作用域、bean生命周期注解
1、bean的作用域
1) singleton :单例,spring默认配置,一个spring容器中只有一个bean的实例,全容器共享一个实例。
2) Prototpe :多实例,每次调用创建一个bean实例
3) Request :
4) Session :
5) GlobalSession :
2、bean的生命周期
12
四、main方法入口注解
1@SpringBootApplication2
3
五、aop注解
2
3
4
4@RestControllercontroller层注解,相当于@ResponseBody和@Controller的组合注解5@Controllercontroller层注解6@ResponseBody返回json格式,与@Controller搭配使用7@RequestMapping请求路径限制8@RequestParam读取请求参数9
@Mapper
@Repository
3@Param
4
四、表的映射1@Entity实体类注解2@Table表名3@Id表中的id4@Transient
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。