diff --git a/src/main/java/org/ktc2/cokaen/wouldyouin/reservation/persist/ReservationRepository.java b/src/main/java/org/ktc2/cokaen/wouldyouin/reservation/persist/ReservationRepository.java index 4739e588..810e248a 100644 --- a/src/main/java/org/ktc2/cokaen/wouldyouin/reservation/persist/ReservationRepository.java +++ b/src/main/java/org/ktc2/cokaen/wouldyouin/reservation/persist/ReservationRepository.java @@ -11,12 +11,12 @@ public interface ReservationRepository extends JpaRepository { @Query("SELECT R FROM Reservation R JOIN FETCH R.member JOIN FETCH R.event " - + "WHERE R.member.id = :memberId AND R.id > :lastId " + + "WHERE R.member.id = :memberId AND R.id < :lastId " + "ORDER BY R.id DESC") Slice findByMemberIdOrderByReservationIdDesc(Long memberId, Long lastId, Pageable pageable); @Query("SELECT R FROM Reservation R JOIN FETCH R.member JOIN FETCH R.event " - + "WHERE R.event.id = :eventId AND R.id > :lastId " + + "WHERE R.event.id = :eventId AND R.id < :lastId " + "ORDER BY R.id DESC") Slice findByEventIdOrderByReservationIdDesc(Long eventId, Long lastId, Pageable pageable); diff --git a/src/main/java/org/ktc2/cokaen/wouldyouin/review/persist/ReviewRepository.java b/src/main/java/org/ktc2/cokaen/wouldyouin/review/persist/ReviewRepository.java index 06eb296e..af631e54 100644 --- a/src/main/java/org/ktc2/cokaen/wouldyouin/review/persist/ReviewRepository.java +++ b/src/main/java/org/ktc2/cokaen/wouldyouin/review/persist/ReviewRepository.java @@ -11,12 +11,12 @@ public interface ReviewRepository extends JpaRepository { @Query("SELECT R FROM Review R JOIN FETCH R.member JOIN FETCH R.event " - + "WHERE R.member.id = :memberId AND R.id > :lastId " + + "WHERE R.member.id = :memberId AND R.id < :lastId " + "ORDER BY R.id DESC") Slice findByMemberIdOrderByReviewIdDesc(Long memberId, Long lastId, Pageable pageable); @Query("SELECT R FROM Review R JOIN FETCH R.member JOIN FETCH R.event " - + "WHERE R.event.id = :eventId AND R.id > :lastId " + + "WHERE R.event.id = :eventId AND R.id < :lastId " + "ORDER BY R.id DESC") Slice findByEventIdOrderByReviewIdDesc(Long eventId, Long lastId, Pageable pageable);