Skip to content

Commit

Permalink
#27 fix(product): ArtistInfo entity 변경에 따른 쿼리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-mer committed Oct 27, 2024
1 parent 36bd84f commit 30769a7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {

@Query("SELECT p.id AS id, p.name AS name, a.name AS artist, p.price AS price " +
@Query("SELECT p.id AS id, p.name AS name, a.nickname AS artist, p.price AS price " +
"FROM Product p JOIN p.artistInfo a " +
"WHERE p.name LIKE %:query%") // Index 미사용
Page<ProductSearch> findByName(@Param("query") String query, Pageable pageable);

@Query(value = "SELECT p.id, p.name, a.name AS artist, p.price " +
@Query(value = "SELECT p.id, p.name, a.nickname AS artist, p.price " +
"FROM product p JOIN artist_info a ON p.artist_info_id = a.id " +
"WHERE MATCH(p.name) AGAINST (:query IN BOOLEAN MODE)",
countQuery = "SELECT COUNT(*) " +
Expand Down

0 comments on commit 30769a7

Please sign in to comment.