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을 이용한 쿼리 최적화 #112

Merged
merged 9 commits into from
Oct 24, 2023

Conversation

jun02160
Copy link
Member

📌 관련 이슈

close #108

✨ 어떤 이유로 변경된 내용인지

  • Quertdsl을 적용하여 DAO에서 사용했던 jpql 코드를 최적화했습니다
  • 의존성 라이브러리 충돌 문제로 정리해둔 내용 노션에 기록해두었으니 참고해주세요!

🙏 검토 혹은 리뷰어에게 남기고 싶은 말

  • 아직 리뷰 확인 후에 지우려고 DAO에서 기존에 사용했던 코드들 주석처리로 남겨두었습니다! 리뷰 달아주신 이후에 지우도록 하겠습니다
  • 다음 이슈는 2주.. 내로 해야죠 하핫

@jun02160 jun02160 added 🔥 Pull Request PR 날림 예준🍒 🔨Refactor 코드 리펙토링 (기능 변경 없이 코드만 수정할 때) ☁️Database DB 관련 labels Oct 11, 2023
@jun02160 jun02160 requested a review from ddongseop October 11, 2023 18:17
@jun02160 jun02160 self-assigned this Oct 11, 2023
@jun02160 jun02160 changed the title [REFACTOR] querydsl optimization [REFACTOR] Querydsl을 이용한 쿼리 최적화 Oct 11, 2023
Copy link
Member

@ddongseop ddongseop left a comment

Choose a reason for hiding this comment

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

나도 얼른 공부한다음 리팩토링 할 부분 보이면 그때 추가로 할게!!
수고했어~~

String cronExpression = String.format("0 %s %s * * ?", pc.getPushTime().getMinute(), pc.getPushTime().getHour());
// String cronExpression = String.format("*/20 * * * * *");
// String cronExpression = String.format("0 %s %s * * ?", pc.getPushTime().getMinute(), pc.getPushTime().getHour());
String cronExpression = String.format("*/20 * * * * *");
Copy link
Member

Choose a reason for hiding this comment

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

이거 이상태로 올라가면 안될거 같아요!
수정 부탁쓰~

Copy link
Member Author

Choose a reason for hiding this comment

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

어이쿠 오케이 !!!

}

private BooleanExpression userIdEq(Long userId) {
return userId != null ? user.id.eq(userId) : null;
}
Copy link
Member

Choose a reason for hiding this comment

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

이렇게 주석까지 남겨주니까 보기 너무 좋다~ 굿굿

Comment on lines +32 to +40
def queryDslDir = "build/querydsl/generated"

sourceSets {
main.java.srcDirs += [queryDslDir]
}

//def queryDslDir = "build/querydsl/generated"
//
//sourceSets {
// main.java.srcDirs += [queryDslDir]
//}
//
//tasks.withType(JavaCompile) {
// options.annotationProcessorGeneratedSourcesDirectory = file(queryDslDir)
//}
//
//clean.doLast {
// file(queryDslDir).deleteDir()
//}
tasks.withType(JavaCompile) {
options.getGeneratedSourceOutputDirectory().set(file(queryDslDir))
}
Copy link
Member

Choose a reason for hiding this comment

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

build.gradle에서도 설정해줘야 하는구나,, 수고했으!!

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
Member

Choose a reason for hiding this comment

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

우리는 멀티모듈이어서 강의랑 다르게 적용해야 했구나,,, 🤣

@jun02160 jun02160 merged commit b5e4fcb into develop Oct 24, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️Database DB 관련 예준🍒 🔥 Pull Request PR 날림 🔨Refactor 코드 리펙토링 (기능 변경 없이 코드만 수정할 때)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] Querydsl을 이용한 쿼리 최적화
2 participants