diff --git a/findMuse-API/src/main/java/com/whh/findmuseapi/art/repository/ArtRepository.java b/findMuse-API/src/main/java/com/whh/findmuseapi/art/repository/ArtRepository.java index ce4802e..d02b4b1 100644 --- a/findMuse-API/src/main/java/com/whh/findmuseapi/art/repository/ArtRepository.java +++ b/findMuse-API/src/main/java/com/whh/findmuseapi/art/repository/ArtRepository.java @@ -31,13 +31,13 @@ public interface ArtRepository extends JpaRepository { List findArtByDate(Long userId); // 취향 별 랜덤 추출 5개 - @Query(value = "select a from Art a where a.artType = :type and a.randomId >= floor(rand() * 100000000) limit 5", nativeQuery = true) + @Query(value = "select * from Art a where a.art_type = :type and a.random_id >= floor(rand() * 100000000) limit 5", nativeQuery = true) List findArtByGenre(ArtType type); // 취향 정보가 없을 때 랜덤 추출 5개 - @Query(value = "select a from Art a where a.randomId >= floor(rand() * 100000000) limit 5", nativeQuery = true) + @Query(value = "select * from Art a where a.random_id >= floor(rand() * 100000000) limit 5", nativeQuery = true) List findArtByNoGenre(); - @Query(value = "select a from Art a where a.startDate >= :date and a.randomId >= floor(rand() * 100000000) limit 1", nativeQuery = true) + @Query(value = "select * from Art a where a.start_date >= :date and a.random_id >= floor(rand() * 100000000) limit 1", nativeQuery = true) Art findArtByTodayAndRandom(String date); }