Skip to content

Conversation

@Kimsejin-56
Copy link
Contributor

No description provided.

@Kimsejin-56 Kimsejin-56 merged commit e016334 into main Oct 11, 2025
1 check passed
* (작성자(User) 엔티티까지 한 번에 가져오기)
*/
@EntityGraph(attributePaths = {"user"}) // Review의 user 필드 fetch join
List<Review> findAllByStoreOrderByCreatedAtDesc(Store store);
Copy link

@ggamnunq ggamnunq Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch join하는 jpql query를 직접 작성해보면 좋을 것 같습니다

* 4. 홈화면 대시보드 조회
* - 최근 리뷰한 가게 지역 + 포인트 + 알람 여부 + 완료 미션 수
*/
@Query("""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 부분 서브쿼리가 아닌 조인으로도 구현 가능할 것 같습니다.
서브쿼리는 예상치 못하게 다량의 쿼리가 발생할 수 있고, 성능 또한 조인이 일반적으로 더 좋습니다.
개인적으로 조인하는 방법을 추천합니다.
또한 Left, Right 조인도 적극 활용해보면 좋을듯 합니다.

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

Successfully merging this pull request may close these issues.

3 participants