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

[feat] 이벤트 유저를 다양한 조건으로 검색할 수 있게 개선(#135) #139

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

blaxsior
Copy link
Collaborator

@blaxsior blaxsior commented Aug 22, 2024

#️⃣ 연관 이슈

📝 작업 내용

이벤트 유저를 frameId, 전화번호를 기준으로도 검색할 수 있도록 구현했습니다. 초기에는 JPA Specification을 기반으로 기능을 구현했으나, join을 수행하더라도 연관 객체 정보를 함께 가져오지 않아 N+1 문제를 겪었고, fetch의 경우 일관성 없이 동작하는 문제가 있었습니다. 이로 인해 JPA Specification만으로는 한계가 있다고 생각하여 queryDSL을 도입, 동일 로직을 구현하여 문제를 해결했습니다.

https://github.com/softeerbootcamp4th/Team6-AwesomeOrange-BE/wiki/%ED%8A%B8%EB%9F%AC%EB%B8%94%EC%8A%88%ED%8C%85#jpa-specification%EC%9D%98-%EB%8B%A8%EC%A0%90%EA%B3%BC-querydsl%EC%9D%98-%EB%8F%84%EC%9E%85

@blaxsior blaxsior added the feat 기능 구현 label Aug 22, 2024
@blaxsior blaxsior self-assigned this Aug 22, 2024
@win-luck win-luck self-requested a review August 22, 2024 10:35
Copy link
Collaborator

@win-luck win-luck left a comment

Choose a reason for hiding this comment

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

QueryDSL를 적절한 상황에 도입해서 문제를 해결해서 너무 다행이네요. 낯선 스택이라서 촉박한 시간 이내에 활용하기가 쉽지 않았을 것 같은데 너무너무 고생많으셨습니다.

@TestConfiguration
public class TestConfig {
@PersistenceContext
private EntityManager entityManager;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

QueryDSL의 경우 JPA persistence layer에 속해있지 않아 DataJPATest을 이용할 때 자동으로 bean으로 등록되지 않는다고 합니다. 이로 인해 DataJPATest에서 필요로 하는 QueryDSL 관련 Bean이 없는 상태가 되어 NoSuchBeanDefinitionException이 발생한다고 하네요. 이를 방지하기 위해 test configuration으로 설정을 만들어줬습니다.

참고 경로입니다.

https://velog.io/@gloz0315/QueryDSL-Test-%EC%BD%94%EB%93%9C-%EB%AC%B8%EC%A0%9C-%EB%B0%8F-%ED%95%B4%EA%B2%B0

@blaxsior blaxsior merged commit c40f7f1 into dev Aug 22, 2024
1 check passed
@win-luck win-luck deleted the feature/135-event-user-multi-search branch August 30, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 이벤트 유저를 다양한 조건으로 검색할 수 있게 개선(#135)
2 participants