Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- mysql
- 리눅스
- Git
- DTO
- 컴파일 타임 상수
- 프로그래머스
- 알고리즘
- 메모리 구조
- 편향된 지수
- m:n
- 오블완
- @Autowired
- 커밋 되돌리기
- 쉘 스크립트
- JDBC
- @SubscribeMapping
- JPA
- compgen
- application layer
- spring
- 런타임 상수
- intelij spring config
- BindingResult
- 파이썬
- 기본키 전략
- 쿠키
- 백준
- 티스토리챌린지
- allocationSize
- API
Archives
- Today
- Total
목록@JoinColumn (1)
둘셋 개발!
[JPA] 일대다 양방향에서 '다'엔티티에 @JoinColumn을 생략하면 안되는 이유
(우선 일대다 양방향은 잘 쓰지 않는다) 일대다 양방향을 공부하던 도중, 다 방향에 있는 엔티티에 @ManyToOne만 달아도 연관관계 된 객체를 알 수 있는데 왜 @JoinColumn(name = "~~", insertable=false, updatable = false)을 넣어야 되는지 궁금해졌다. 그래서 @ManyToOne만 달아보았다. 예제는 post와 comment이다. post.java@Entity public class Post { @Id @GeneratedValue private Long id; @OneToMany @JoinColumn(name = "POST_ID") private List comments = new ArrayList(); //... } comment.java@Entity ..
JPA
2023. 9. 22. 20:07