> 文章列表 > SSM常用注解总结

SSM常用注解总结

SSM常用注解总结

目录

一、Spring

@Component / @Controller / @Service / @Repository

@Configuration

 @ComponentScan

@Scope

 @PostConstruct

@PreDestroy

 @Autowired

 @Qualifier

@Value

 @PropertySource

 @Bean​编辑

@Import

 @RunWith

@ContextConfiguration​编辑

 @EnableAspectJAutoProxy

 @Aspect​编辑

 @Pointcut​编辑

 @Before​编辑

 @After​编辑

 @AfterReturning​编辑

 @AfterThrowing​编辑

 @Around​编辑

 @EnableTransactionManagement

 @Transactional​编辑

 二、SpringMVC

@Controller​编辑

 @RequestMapping

 @ResponseBody​编辑

 @ComponentScan​编辑

 @RequestParam​编辑

@EnableWebMvc​编辑

 @RequestBody

 @DateTimeFormat​编辑

 @ResponseBody​编辑

 @PathVariable​编辑

 @RestController​编辑

 @GetMapping @PostMapping @PutMapping @DeleteMapping​编辑

 @RestControllerAdvice​编辑

 @ExceptionHandler​编辑

 三、MyBatisPlus

Lombok常见注解

@TableField​编辑 

@TableName​编辑

 @TableId​编辑

 @TableLogic​编辑


*SSM框架spring、spring MVC 、和mybatis框架的整合,是标准的MVC模式。

*标准的SSM框架有四层,分别是dao层(mapper),service层,controller层和View层

*使用spring实现业务对象管理,使用spring MVC负责请求的转发和视图管理,mybatis作为数据对象的持久化引擎

MybatisPlus:

(简称MP)是基于MyBatis框架基础上开发的增强型工具,旨在简化开发、提供效率。

一、Spring

@Component / @Controller / @Service / @Repository

@Configuration

 @ComponentScan

@Scope

 @PostConstruct

@PreDestroy

 @Autowired

 @Qualifier

@Value

 @PropertySource

 @Bean

@Import



 @RunWith

@ContextConfiguration @EnableAspectJAutoProxy

 @Aspect

 @Pointcut

 @Before

 @After

 @AfterReturning

 @AfterThrowing

 @Around

 @EnableTransactionManagement

 @Transactional

 二、SpringMVC

@Controller

 @RequestMapping

 @ResponseBody

 @ComponentScan

 @RequestParam

@EnableWebMvc @RequestBody

 @DateTimeFormat

 @ResponseBody

 @PathVariable

 @RestController

 @GetMapping @PostMapping @PutMapping @DeleteMapping

 @RestControllerAdvice

 @ExceptionHandler

 三、MyBatisPlus

Lombok常见注解:

@Setter:为模型类的属性提供setter方法
@Getter:为模型类的属性提供getter方法
@ToString:为模型类的属性提供toString方法
@EqualsAndHashCode:为模型类的属性提供equals和hashcode方法
@Data:是个组合注解,包含上面的注解的功能
@NoArgsConstructor:提供一个无参构造函数
@AllArgsConstructor:提供一个包含所有参数的构造函数

@TableField @TableName

 @TableId

 @TableLogic