-
Notifications
You must be signed in to change notification settings - Fork 0
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] 족보 상세보기에서 식당 정렬순 족보에 추가한 순으로 변경 #167
Conversation
ca7db14
to
e9d4735
Compare
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.
개인적인 궁금증인데, 정렬하기 위해 쿼리를 따로 생성하지 않고 FavoriteStore 엔티티의 필드에 @orderby 어노테이션을 이용해서 정렬을 간편화할 수 있는데 이런 방식을 선택한 이유가 무엇인가요?
@@ -50,7 +51,7 @@ private List<Store> findStoresInFavorite(final Favorite favorite){ | |||
if (favoriteHasNoStore(favorite)) { | |||
return new ArrayList<>(); | |||
} | |||
return storeFinder.findAllByIdsWhereDeletedIsFalseOrderByCreatedAtDes(favorite.getFavoriteStores().stream().map(fs -> fs.getStore().getId()).toList()); | |||
return storeFinder.findAllByIdsWhereDeletedIsFalseOrderByFavoriteStoreId(favorite.getFavoriteStores()); |
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.
함수명 findAllByFavoriteStoreWhereDeletedIsFalse
로 변경하는 것은 어떨까요?
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.
반영했습니당 👍
store은 페이징 때문에 in 쿼리로 가져와야하기 때문에 이렇게 했습니당 |
e9d4735
to
945c17c
Compare
Related Issue 📌
close #166
Description ✔️
To Reviewers
(족보에 가게 있다면)
2. favoriestore와 store 그냥 join 함 - 이미 1번으로 인해 FavoriteStore 영속성에 있으므로 굳이 fetch join 할 필요없음
<족보에 가게 있을 경우>
<족보에 가게 없을 경우>