注解
注解 | 作用 |
---|---|
@Insert | 增加注解 |
@Delete | 删除注解 |
@Update | 修改 |
@Select | 查询 |
@Configuration | 配置文件 |
@PropertySource | 读取properties文件 |
@ComponentScan | 包扫描 |
@Import | 导入 |
@EnableAspectJAutoProxy | 开启AOP |
@Value | 获取配置文件值 |
@Bean | bean的 创建 |
@Autowired | 注入 |
@Qualifier | |
@EnableTransactionManagement | 开启事务 |
@Transactional | 事务 |
@Component | spring注解 |
@Scope | bean实例 |
@PostConstruct | 设定bean的生命周期-销毁 |
@PreDestroy | 设定bean的生命周期-新建 |
@Resource | 可以替代掉 @Autowired @Qualifier 但是不推荐使用 |
@Primary | 作用:设置类对应的bean按类型装配时优先装配 |
@RunWith | |
@ContextConfiguration | 设定spring专用的类加载器 |
@ContextConfiguration | 设定加载的spring上下文对应的配置 |
@Controller | 表现层 |
@Service | 业务层 |
@Repository | 数据层 |
@RestController | @Controller+@ResponesBody |
@RequestMapping | |
@RequestParam | List 别名 |
@DateTimeFormat | 日期 |
@ResponesBody | 不跳钻页面 返回数据 |
@RequestBody | 接收Ajax数据 |
@CookieValue | 获取cookie |
@SessionAttribute | 获取Session |
@SessionAttributes | 设置匹配Sessin |
@RequestHeader | 获取请求头 |
@CrossOrigin | 跨域 |
@PathVariable | 获取路径变量 |
@GetMapping | 查询 |
@PostMapping | 修改 |
@PutMapping | 增加 |
@DeleteMapping | 删除 |