320x100
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
}
strategy = GenerationType.IDENTITY 로 지정해주면
기본키 시퀀스가 AUTO_INCREMENT 로 생성된다.
320x100
'Spring Boot' 카테고리의 다른 글
[Spring Boot] CORS Configuration 설정하기 (0) | 2023.06.23 |
---|---|
[Spring Boot] RequestMapping VS PostMapping/GetMapping (0) | 2023.03.23 |
[JPA] Persistable 인터페이스 (0) | 2022.11.22 |
[Spring Boot] 개발환경 설정 -(6) profile별 로그 설정하기(hibernate 등) (0) | 2022.11.01 |
[Spring Boot] 개발환경 설정 -(5) mySQL JPA 연동하기-② (0) | 2022.06.30 |