Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
이 변경으로 인해 아직 시작되지 않은 제휴도 조회 결과에 포함되게 됩니다. 이는 의도된 동작으로 보입니다.
다만
@Where어노테이션은 해당 엔티티에 대한 모든 조회 쿼리에 전역적으로 필터 조건을 추가하므로, 의도치 않은 부작용을 일으킬 수 있습니다. 예를 들어, 관리자가 만료된 제휴 정보를 조회하거나 수정해야 할 경우,@Where조건 때문에 엔티티를 불러오지 못하는 문제가 발생할 수 있습니다.장기적으로는
@Where를 사용하는 대신, 다음과 같은 방법을 고려해 보시는 것을 추천합니다:findActivePartnerships,findAllIncludingFuturePartnerships)추가적으로, 이 변경으로 인해
PartnershipRepository의findRestaurantsWithMyPartnerships쿼리에 있는p.endDate >= current_date조건이 중복됩니다.@Where가 적용되므로 해당 쿼리 내의 조건은 제거해도 동일하게 동작할 것입니다. 이는@Where가 코드베이스 전반에 미치는 영향을 보여주는 좋은 예시입니다.이 수정이 임시 조치임을 감안할 때, 추후 리팩토링을 위한 이슈를 생성해두는 것도 좋은 방법입니다.