전체 글 124

managing images separately instead of at the SKU level (ProductEntity, ProductColorVariantEntity)

I understand that in the product list, SKUs with the same size used to share the same image, and individual images weren't registered for each SKU. Now, this has been changed so that SKUs with the same color use the same image. SKUs no longer directly own images; instead, they refer to productColorVariant to fetch the image corresponding to that color. 현재는 productEntity가 sku를 리스트로, sku가 이미지를 리스트..

카테고리 없음 2025.06.11

QueryDSL does not support using limit() inside subqueries when used with JPA.

상품 목록에서 대표이미지를 보여주기로 했다. 여기서부터 문제가 생겼는데..1. 스칼라 서브쿼리에서는 limit 옵션을 사용할 수 없다.limit(1) 옵션을 넣어도, 실제 쿼리에는 limit 옵션이 빠진 query가 나가는걸 확인했다.이유는.. 그냥 JPQL을 사용할 때의 제약조건이다.여러 해결책이 있을 수 있지만, 쿼리를 분리하기로 했다.먼저 제품 목록을 가지고 오고, 그 목록을 기준으로 join 하면서 해당하는 썸네일을 넣어주자. limit을 사용했지만, 실제 쿼리에서는 나가지 않는다..@Overridepublic Page findAllProductsWithMinPriceAndMaxPrice(String name, String skuCode, Pageable pageable) { // 메인 쿼..

Errors 2025.06.09