Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onetomany manytoone join column #9

Open
alertjjm opened this issue Oct 6, 2021 · 0 comments
Open

onetomany manytoone join column #9

alertjjm opened this issue Oct 6, 2021 · 0 comments

Comments

@alertjjm
Copy link
Member

alertjjm commented Oct 6, 2021

OneToMany단방향일때는
@onetomany
@JoinColum(name="FK")
로 쓰면 알아서 관리해주고, OneToMany에서도 JoinColumn을 쓸 수 있음.

양방향일때는
@onetomany(mappedBy="Many쪽 필드")

@manytoone
@joincolumn(name="FK")
로 해주고, One쪽에서 mappedBy가 연관관계의 주인이 아니라서 거슬리는 문제들이 발생하잖아

그러면 그냥 @onetomany, @manytoone양쪽에다가 다 JoinColumn해주면 되지않으까?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant