diff --git a/src/main/java/khu/bigdata/infou/implement/LectureService.java b/src/main/java/khu/bigdata/infou/implement/LectureService.java index 993d729..5af602d 100644 --- a/src/main/java/khu/bigdata/infou/implement/LectureService.java +++ b/src/main/java/khu/bigdata/infou/implement/LectureService.java @@ -120,7 +120,7 @@ public LectureResponseDTO.LectureDetailDto findLectureDetail(Integer lectureId) */ public LectureResponseDTO.OtherStudentsDto findOtherStudents() { - List platformStudents = platformStudentRepository.findAllWithUdemyUserId(); + List platformStudents = platformStudentRepository.findTop1000ByUdemyUserIdIsNotNull(); // 가져온 데이터를 List로 변환 List studentList = platformStudents.stream() diff --git a/src/main/java/khu/bigdata/infou/repository/PlatformStudentRepository.java b/src/main/java/khu/bigdata/infou/repository/PlatformStudentRepository.java index 5999329..c1dd00a 100644 --- a/src/main/java/khu/bigdata/infou/repository/PlatformStudentRepository.java +++ b/src/main/java/khu/bigdata/infou/repository/PlatformStudentRepository.java @@ -2,12 +2,11 @@ import khu.bigdata.infou.domain.PlatformStudent; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; import java.util.List; public interface PlatformStudentRepository extends JpaRepository { - @Query("SELECT p FROM PlatformStudent p WHERE p.udemyUserId IS NOT NULL") - List findAllWithUdemyUserId(); + // @Query("SELECT p FROM PlatformStudent p WHERE p.udemyUserId IS NOT NULL") + List findTop1000ByUdemyUserIdIsNotNull(); }