Spring注解简单总结

Spring annotation 总结
@EnableAutoConfiguration: 让spring 根据所选依赖猜测项目目的,然后自动配置,在@SpringBootApplication
@AutoWired:构造器注入
@RequestMapping :处理http请求,从url提取信息进行处理
@RestController:发送返回字符串给请求
@SpringBootApplication: 启动自动配置和自动扫描组件
@Import : 导入其他配置类
@ComponentScan:扫描所有spring组件@Component(已包含在@SpringBootApplication中)
@ImportResource:加载XML配置文件
@Configuration:注册上下文中其他的bean,或者导入其他配置类,在@SpringBootApplication
@Id: 指定主键
@GeneratedValue:配合@Id对主键策略进行详细配置
@Column 声明变量时使用,标注非主键的列

你可能感兴趣的:(Java)