Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 597 Bytes

09.1-various-relationship-mapping.md

File metadata and controls

13 lines (11 loc) · 597 Bytes

실습 repo: https://github.com/siwony/HelloJPA/tree/variousRelationshipMapping_03

다양한 연관관계 매핑(실전)

엔티티 - 배송, 카테고리 추가

ERD

N:M 관계는 1:N, N:1로

: 테이블의 N:M 관계는 중간 테이블을 이용하여 1:N, N:1

  • 실전에서 중간 테이블은 단순하지 않다.
  • @ManyToMany는 제약: 필드 추가 x, 엔티티 테이블 불일치
  • 실전에서는 @ManyToMany 사용하지 말자.