개발/JPA

Jpa에서 테이블 내부, 외부

멋진놈 2022. 8. 26. 13:45
728x90

외부에서는

/**
 * joinColumn participant id
 */
@ManyToOne
@JoinColumn(name = "participant_id")
private Participant participant;

로 선언 해줘서 participant id(외래키) 값을 가져오는데, 

 

 

내부

pariticipant 쪽에서는 이 OneToMany를 안해줘도 됨 해보니.