• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

hibernate 6 부터는 항상 distinct 가 적용된다고 합니다. 따라했는데 결과가 다르게 나와서 한참 해맸네요

23.06.20 17:05 작성 조회수 723

1

원문입니다.

DISTINCT

Starting with Hibernate ORM 6 it is no longer necessary to use distinct in JPQL and HQL to filter out the same parent entity references when join fetching a child collection. The returning duplicates of entities are now always filtered by Hibernate.

Which means that for instance it is no longer necessary to set QueryHints#HINT_PASS_DISTINCT_THROUGH to false in order to skip the entity duplicates without producing a distinct in the SQL query.

From Hibernate ORM 6, distinct is always passed to the SQL query and the flag QueryHints#HINT_PASS_DISTINCT_THROUGHhas been removed.

답변 1

답변을 작성해보세요.

1

y2gcoder님의 프로필

y2gcoder

2023.06.20

안녕하세요. Yongin Jo님, 공식 서포터즈 y2gcoder입니다.

정보 공유해주셔서 감사합니다!
아마 변경 전의 강의자료를 갖고 계신 것 같습니다. 2023-01-30 기준 강의자료 중 10. 객체지향 쿼리 언어.pdf의 72p를 보시면 해당 내용이 있습니다 :)

image

감사합니다.

Yongin Jo님의 프로필

Yongin Jo

질문자

2023.06.23

이렇게까지 A/S가 되고있는지 몰랐네요.

감사합니다.

y2gcoder님의 프로필

y2gcoder

2023.06.23

파이팅입니다!

dlsrksrhk님의 프로필

dlsrksrhk

2024.04.13

아마도 PDF상에 DISTINCT에 대한 설명이 끝나고 난 이후 페이지에 넣어둬서 그런것 같은데, 컬렉션 페치 조인 초반에 넣어주면 더 도움이 될 것 같아욤~ 같은 이유로 검색해 보다가 남깁니다.