Spring
Data
- @DynamicInsert
- @DynamicUpdate
- @Entity
- @Table(name = "")
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "")
Spring
- @Bean
- @Component
- @ComponentScan(basePackages = "com.chen.learnspring")
- @Profile(value = "prod")
- @Autowired
- @Conditional
- @Primary
- @Qualifier("bean id")
- @Scope("prototype") 設(shè)置bean的作用域: "Singleton" :單例 , "Prototype" : 原型(每次注入都會(huì)創(chuàng)建新的bean),"Session": 會(huì)話(huà),"Request" : 請(qǐng)求. (Spring實(shí)戰(zhàn)第4版 86頁(yè))
AOP
- @Aspect
- @Before
- @AfterReturning
- @AfterThrowing
- @Around
- @EnableAspectJAutoProxy
- PointCut
- DeclareParents
spring.aop.auto=true SpringBoot
Test
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration(classes = CDPlayerConfig.class)
- @ActiveProfiles(value = "prod")
校驗(yàn)注解 javax.validation.constraints
- AssertFalse
- AssertTrue
- DecimalMax
- DecimalMin
- Digits
- Size
- PositiveOrZero
- Positive
- Pattern
- Min
- Max
- Future
異常
- @ResponseStatus(value = HttpStatus.ACCEPTED,reason = "Not Found")
- @ExceptionHandler