diff --git a/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepository.java b/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepository.java index 9fe0cf623..200c8d977 100644 --- a/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepository.java +++ b/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepository.java @@ -1,9 +1,11 @@ package zipgo.petfood.infra.persist; import com.querydsl.core.types.dsl.BooleanExpression; +import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.List; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import zipgo.petfood.domain.PetFood; @@ -15,6 +17,7 @@ import static zipgo.review.domain.QAdverseReaction.adverseReaction; import static zipgo.review.domain.QReview.review; +@Slf4j @Repository @RequiredArgsConstructor @Transactional(readOnly = true) @@ -117,12 +120,18 @@ private BooleanExpression isContainFunctionalities(List functionalityLis } public PetFood findPetFoodWithReviewsByPetFoodId(Long petFoodId) {; - return queryFactory + JPAQuery where = queryFactory .selectFrom(petFood) .leftJoin(petFood.reviews.reviews, review) .fetchJoin() .leftJoin(review.adverseReactions, adverseReaction) - .where(petFood.id.eq(petFoodId)) + .where(petFood.id.eq(petFoodId)); + + log.info("----------------1-----------"); + log.info(where.toString()); + log.info("----------------2----------"); + + return where .fetchOne(); }