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

refactor: 식품에 따른 review 조회 N+1 문제 해결 #200

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

parkmuhyeun
Copy link
Member

📄 Summary

🙋🏻 More

N+1 문제 해결, 조만간 fetch join 관련해서 블로깅해야겠다~

Copy link
Collaborator

@iamjooon2 iamjooon2 left a comment

Choose a reason for hiding this comment

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

그 유명한 N+1 문제, 맛있었나요?

저도 얼른 만나서 맛보고싶네요 😋

고생하셨습니다💪

import zipgo.review.domain.Review;
import zipgo.review.exception.ReviewException;

public interface ReviewRepository extends JpaRepository<Review, Long> {

@Query("select r from Review r join fetch r.adverseReactions where r.petFood.id = :petFoodId")
Copy link
Collaborator

Choose a reason for hiding this comment

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

이런 문법이 있었나? 했는데 JPQL이라는 친구였군요ㅋㅋㅋㅋ

Copy link
Member Author

Choose a reason for hiding this comment

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

마자용

Copy link
Collaborator

@kyY00n kyY00n left a comment

Choose a reason for hiding this comment

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

수고했어 무민👏🏻

Copy link
Collaborator

@wonyongChoi05 wonyongChoi05 left a comment

Choose a reason for hiding this comment

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

수고했어 민무~

@parkmuhyeun parkmuhyeun merged commit c87f705 into develop Aug 7, 2023
@iamjooon2 iamjooon2 deleted the refactor/#199 branch August 7, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BE] Review 조회시 N+1 문제
4 participants