JPA 연관관계 List vs Set #42
sangwonsheep
started this conversation in
General
Replies: 2 comments
-
|
저는 List를 사용하는 방식을 선호합니다. 컬렉션이 아직 초기화 되지 않은 상태에서 값을 넣게 되면 프록시가 강제로 초기화되는 문제가 발생합니다. 반면에 List는 이런 중복 체크가 필요없기 때문에 추가할 때 프록시 초기화가 발생하지 않습니다. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
저도 List를 사용하는 방식이 더 좋다고 생각합니다. Set의 경우 조인 테이블에 중복되는 레코드가 많아지는걸 방지하기 위해 사용하는 것 같습니다. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
아래와 같은 코드가 있을 때 Set, List 중에 어떤 방식이 더 좋을까요?
Beta Was this translation helpful? Give feedback.
All reactions