cheese10yun / blog-comment

0 stars 0 forks source link

Spring-Jpa Best Practices Step-08 - OneToOne 관계 설정 팁 - Yun Blog | 기술 블로그 #57

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Spring-Jpa Best Practices Step-08 - OneToOne 관계 설정 팁 - Yun Blog | 기술 블로그

Yun Blog | 기술 블로그

https://cheese10yun.github.io/spring-jpa-best-08/

wannte commented 2 years ago

OneToOne의 연관관계 주인 결정에 대해서 계속 고민하고 있었는데, 고민이 해결되는 글이었습니다!

nullable=false의 조건으로 lefter join과 inner join이 별도로 나가는 것도 처음 배워가고요!

저 같은 경우에는 '청원(Petition)->청원 답변(Answer)' 이 1대1 관계를 가지는 요구사항이 있는데요,

Answer테이블의 petition_id에 unique=true 조건을 걸어, 하나의 청원에 대해 동시에 여러 답변 요청이 왔을 때의 동시성 이슈에서 안전해질 수 있어서 이런 장점도 있을 것 같아 글 남겨봅니다!

leehyeonmin34 commented 2 years ago

JPA Best practice 시리즈 잘 보고 있습니다. 혼자 공부할 때 막막한 점이 많았는데 좋은 내용이 많아요!!