Skip to content

Commit

Permalink
refactor: 장르 리포지토리 애니메이션 Id로 장르 목록 조회 쿼리 수정 #147
Browse files Browse the repository at this point in the history
  • Loading branch information
FaberJoo committed Dec 11, 2023
1 parent 691d028 commit 2395eb7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ public class GenreRepositoryCustomImpl implements GenreRepositoryCustom{
public List<Genre> findAllByAnimeId(Long animeId) {
JPAQuery<Genre> genreJPAQuery = queryFactory.select(genre)
.from(genre)
.join(animeGenre).on(animeGenre.anime.id.eq(animeId))
.join(animeGenre).on(genre.id.eq(animeGenre.genre.id))
.where(
animeGenre.anime.id.eq(animeId),
genre.deletedAt.isNull()
);
)
.limit(3);
return genreJPAQuery.fetch();
}

Expand Down

0 comments on commit 2395eb7

Please sign in to comment.