-
Notifications
You must be signed in to change notification settings - Fork 0
[Release] v2.0.7 릴리즈 #233
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
[Release] v2.0.7 릴리즈 #233
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,6 @@ public interface PartnershipRestaurantRepository extends JpaRepository<Partnersh | |
| LEFT JOIN FETCH pr.partnerships p | ||
| LEFT JOIN FETCH p.partnershipCollege | ||
| LEFT JOIN FETCH p.partnershipDepartment | ||
| WHERE p.startDate <= CURRENT_DATE and (p.endDate is null or p.endDate >= CURRENT_DATE)""") | ||
| WHERE p.startDate >= current_date - 7 and (p.endDate is null or p.endDate >= CURRENT_DATE)""") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 쿼리에는 두 가지 개선점을 제안합니다.
WHERE p.startDate >= current_date - 7 and (p.endDate is null or p.endDate >= current_date)") |
||
| List<PartnershipRestaurant> findAllWithDetails(); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JPQL 쿼리 내에 매직 넘버
7이 사용되었습니다. 이 값은 '최근 제휴를 보여주기 위한 기간'이라는 의미를 가지는 것으로 보입니다. 이처럼 의미를 가지는 숫자는 상수로 정의하여 사용하면 코드의 가독성과 유지보수성을 높일 수 있습니다. 예를 들어,PARTNERSHIP_LOOKBACK_DAYS와 같은 이름의 상수로 관리하는 것을 고려해 보세요.