-
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
♻ remove unnecessary JPQL #457
Conversation
|
|
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.
LGTM입니다!!
|
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.
아토 수고하셨습니다. 👍
FROM Recipe r | ||
WHERE r.author.id = :userId | ||
""") | ||
List<Long> findRecipeIdsByUserId(long userId); |
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.
👍 👍
SELECT recipe | ||
FROM CategoryRecipe | ||
WHERE category.name = :category | ||
ORDER BY recipe.createdAt DESC | ||
""") |
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.
이 쿼리 자체는 지울수 없을요?
네임드 쿼리로 변경 가능할 것 같은데 확인 해주실 수 있나요
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.
드라이빙 테이블을 CategoryRecipe
로 바꾸고 싶어서 쿼리를 직접 쓴거기도 하고, Recipe
가 Category
를 들고있지 않아서 불가능합니다!
RecipeRepository
말고 CategoryRepository
에서 실행하면 CategoryRecipe
객체 리스트를 리턴하게 해서 가능합니다.
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.
아토 고생 많으셨습니다!!
@@ -20,49 +20,53 @@ class RecipeRepositoryTest { | |||
private RecipeRepository repository; | |||
|
|||
@Test | |||
@DisplayName("요청한 페이지에 카테고리 이름으로 레시피 id 목록을 반환한다.") | |||
@DisplayName("요청한 페이지에 카테고리 이름으로 레시피 목록을 반환한다.") | |||
void findRecipeIdsByCategory() { |
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.
테스트코드 메서드 명을 같이 수정해도 좋을 것 같아요
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.
좋은 의견입니다! 반영했습니다!
|
제가
findRecipeDataV1
없애는거 따로,findAllByAuthorId
로 JPA 사용하게 바꾸는거 따로 커밋을 했거든요...풀땡기니까 폰드꺼랑 컨플릭트나서 여차저차 해결했더니... PR 창에서 여전히 컨플릭트때문에 머지 못한다고 하더라고요?
그래서 rebase하면서 다시 해결했더니 커밋이 하나가 되었네요....;;
알아보기 힘드시면 브랜치 새로 파서 금방 다시 올리겠습니다 ㅋㅋ ㅜㅜ
의견 주십쇼,,,
+) 아이디 대신 도메인 리턴하도록 변경한 커밋도 추가했습니다~~ 충돌이 안나니까 눈물이 다 나네요
closes #456