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] QueryDSL으로 마이그레이션 #740

Open
jminkkk opened this issue Oct 5, 2024 · 0 comments
Open

[REFACTOR] QueryDSL으로 마이그레이션 #740

jminkkk opened this issue Oct 5, 2024 · 0 comments
Assignees
Labels
BE 백엔드 refactor 요구사항이 바뀌지 않은 변경사항

Comments

@jminkkk
Copy link
Contributor

jminkkk commented Oct 5, 2024

📌 어떤 기능을 리팩터링 하나요?

JPQL, CriteriaAPI, Specification 등을 통해 구현했던 기존 쿼리 메서드를 QueryDSL을 적용하여 마이그레이션 합니다.

AS-IS 1

기존 일치하는 태그 목록에 해당하는 템플릿이 있는지 확인하는 로직

image

TO-BE 1

QueryDsl을 사용하게 될 경우 실제 쿼리와 메서드가 닮아있어 가독성이 좋습니다.

image

AS-IS 2

컴파일 단에서 문법 확인이 불가능했던 기존 JPQL 문

image

TO-BE 2

    return new JPAQueryFactory(entityManager)
        .delete(sourceCode)
        .where(sourceCode.template.id.in(templateIds))
        .execute();

처럼 메서드가 제공되어 수월한 쿼리 작성이 가능합니다.

⏳ 예상 소요 시간

이슈를 완료하기까지 예상되는 소요 시간을 분 or 시간 or 일 단위로 작성해주세요.

🔍 참고할만한 자료(선택)

테코블 - Spring Boot에 QueryDSL을 사용해보자

@jminkkk jminkkk added the refactor 요구사항이 바뀌지 않은 변경사항 label Oct 5, 2024
@jminkkk jminkkk self-assigned this Oct 5, 2024
@Jaymyong66 Jaymyong66 added this to the 6차 스프린트 🦴 milestone Oct 20, 2024
@Jaymyong66 Jaymyong66 added the BE 백엔드 label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 refactor 요구사항이 바뀌지 않은 변경사항
Projects
Status: Todo
Development

No branches or pull requests

2 participants