Skip to content

Commit

Permalink
Fix: #113 내가 만든 사진 jpa 활용시 성능 이슈 고려하여 jpql로 작성하여 완성된(status = COMPLET…
Browse files Browse the repository at this point in the history
…ED) 사진만 내가만든사진조회시 응답되도록 수정
  • Loading branch information
BYEONGRYEOL committed Aug 9, 2024
1 parent d742297 commit 122a34c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ public interface PictureCompletedRepository extends JpaRepository<PictureComplet
+ "from PictureCompleted p "
+ "join PictureGenerateResponse pgres "
+ "where pgres.request.requester = :user "
+ "and pgres.status = com.gt.genti.picturegenerateresponse.model.PictureGenerateResponseStatus.COMPLETED "
+ "and p.pictureGenerateResponse.id = pgres.id ")
Page<PictureCompleted> findAllByUserPagination(@Param(value = "user") User user, Pageable pageable);

List<PictureCompleted> findAllByRequesterOrderByCreatedAtDesc(User requester);
@Query("select p "
+ "from PictureCompleted p "
+ "join PictureGenerateResponse pgres "
+ "where pgres.request.requester = :requester "
+ "and pgres.status = com.gt.genti.picturegenerateresponse.model.PictureGenerateResponseStatus.COMPLETED "
+ "and p.pictureGenerateResponse.id = pgres.id ")
List<PictureCompleted> findAllByRequesterOrderByCreatedAtDesc(@Param(value = "requester") User requester);
}

0 comments on commit 122a34c

Please sign in to comment.