diff --git a/src/main/generated/org/store/clothstar/order/dto/reponse/QOrderResponse.java b/src/main/generated/org/store/clothstar/order/dto/reponse/QOrderResponse.java deleted file mode 100644 index a41b13b0..00000000 --- a/src/main/generated/org/store/clothstar/order/dto/reponse/QOrderResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.store.clothstar.order.dto.reponse; - -import com.querydsl.core.types.dsl.*; - -import com.querydsl.core.types.ConstructorExpression; -import javax.annotation.processing.Generated; - -/** - * org.store.clothstar.order.dto.reponse.QOrderResponse is a Querydsl Projection type for OrderResponse - */ -@Generated("com.querydsl.codegen.DefaultProjectionSerializer") -public class QOrderResponse extends ConstructorExpression { - - private static final long serialVersionUID = -1258133913L; - - public QOrderResponse(com.querydsl.core.types.Expression orderEntity, com.querydsl.core.types.Expression orderDetailEntity, com.querydsl.core.types.Expression memberEntity, com.querydsl.core.types.Expression addressEntity, com.querydsl.core.types.Expression productLineEntity) { - super(OrderResponse.class, new Class[]{org.store.clothstar.order.entity.OrderEntity.class, org.store.clothstar.orderDetail.entity.OrderDetailEntity.class, org.store.clothstar.member.entity.MemberEntity.class, org.store.clothstar.member.entity.AddressEntity.class, org.store.clothstar.productLine.entity.ProductLineEntity.class}, orderEntity, orderDetailEntity, memberEntity, addressEntity, productLineEntity); - } - -} - diff --git a/src/main/generated/org/store/clothstar/orderDetail/dto/QOrderDetailDTO.java b/src/main/generated/org/store/clothstar/orderDetail/dto/QOrderDetailDTO.java deleted file mode 100644 index bc407ada..00000000 --- a/src/main/generated/org/store/clothstar/orderDetail/dto/QOrderDetailDTO.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.store.clothstar.orderDetail.dto; - -import com.querydsl.core.types.dsl.*; - -import com.querydsl.core.types.ConstructorExpression; -import javax.annotation.processing.Generated; - -/** - * org.store.clothstar.orderDetail.dto.QOrderDetailDTO is a Querydsl Projection type for OrderDetailDTO - */ -@Generated("com.querydsl.codegen.DefaultProjectionSerializer") -public class QOrderDetailDTO extends ConstructorExpression { - - private static final long serialVersionUID = -767891785L; - - public QOrderDetailDTO(com.querydsl.core.types.Expression orderDetailEntity) { - super(OrderDetailDTO.class, new Class[]{org.store.clothstar.orderDetail.entity.OrderDetailEntity.class}, orderDetailEntity); - } - -} - diff --git a/src/main/java/org/store/clothstar/productLine/controller/ProductLineController.java b/src/main/java/org/store/clothstar/productLine/controller/ProductLineController.java index 4dab8b80..d0bef38d 100644 --- a/src/main/java/org/store/clothstar/productLine/controller/ProductLineController.java +++ b/src/main/java/org/store/clothstar/productLine/controller/ProductLineController.java @@ -19,7 +19,6 @@ import org.store.clothstar.productLine.dto.response.ProductLineWithProductsJPAResponse; import org.store.clothstar.productLine.service.ProductLineService; -import java.awt.print.Pageable; import java.net.URI; import java.util.List; diff --git a/src/main/java/org/store/clothstar/productLine/dto/response/ProductLineWithProductsJPAResponse.java b/src/main/java/org/store/clothstar/productLine/dto/response/ProductLineWithProductsJPAResponse.java index 03eabfdc..b28cfa3a 100644 --- a/src/main/java/org/store/clothstar/productLine/dto/response/ProductLineWithProductsJPAResponse.java +++ b/src/main/java/org/store/clothstar/productLine/dto/response/ProductLineWithProductsJPAResponse.java @@ -63,7 +63,7 @@ public class ProductLineWithProductsJPAResponse { private LocalDateTime modifiedAt; @QueryProjection - public ProductLineWithProductsJPAResponse(ProductLineEntity productLine, SellerEntity seller, Long totalStock) { + public ProductLineWithProductsJPAResponse(ProductLineEntity productLine, Seller seller, Long totalStock) { this.productLineId = productLine.getProductLineId(); this.name = productLine.getName(); this.content = productLine.getContent(); diff --git a/src/main/java/org/store/clothstar/productLine/repository/ProductLineRepositoryCustomImpl.java b/src/main/java/org/store/clothstar/productLine/repository/ProductLineRepositoryCustomImpl.java index 2df63e03..f9fc63cd 100644 --- a/src/main/java/org/store/clothstar/productLine/repository/ProductLineRepositoryCustomImpl.java +++ b/src/main/java/org/store/clothstar/productLine/repository/ProductLineRepositoryCustomImpl.java @@ -8,7 +8,8 @@ import org.springframework.data.domain.*; import org.springframework.data.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import org.store.clothstar.member.entity.QSellerEntity; +import org.store.clothstar.member.domain.QMember; +import org.store.clothstar.member.domain.QSeller; import org.store.clothstar.product.dto.response.ProductResponse; import org.store.clothstar.product.entity.QProductEntity; import org.store.clothstar.productLine.dto.response.ProductLineWithProductsJPAResponse; @@ -16,7 +17,10 @@ import org.store.clothstar.productLine.entity.ProductLineEntity; import org.store.clothstar.productLine.entity.QProductLineEntity; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; @Repository @@ -27,8 +31,7 @@ public class ProductLineRepositoryCustomImpl implements ProductLineRepositoryCus QProductLineEntity qProductLine = QProductLineEntity.productLineEntity; QProductEntity qProduct = QProductEntity.productEntity; - QSellerEntity qSeller = QSellerEntity.sellerEntity; - QMemberEntity qMember = QMemberEntity.memberEntity; + QSeller qSeller = QSeller.seller; @Override public Page getProductLinesWithOptions(Pageable pageable) { @@ -103,6 +106,12 @@ public Slice findAllSlicePaging(Pageable pag public Page findEntitiesByCategoryWithOffsetPaging(Long categoryId, Pageable pageable, String keyword) { List content = getProductLineEntitiesByCategory(categoryId, pageable, keyword); + boolean hasNext = false; + if (content.size() > pageable.getPageSize()) { + content.remove(content.size() - 1); + hasNext = true; + } + JPAQuery totalCount = jpaQueryFactory .select(qProductLine.countDistinct()) .from(qProductLine) @@ -177,7 +186,8 @@ private List getProductLineEntitiesByCategory(Long categoryId .selectDistinct(qProductLine) .from(qProductLine) .where(qProductLine.category.categoryId.eq(categoryId) - .and(qProductLine.deletedAt.isNull())) + .and(qProductLine.deletedAt.isNull()) + .and(getSearchCondition(keyword))) .orderBy(orderSpecifiers.toArray(new OrderSpecifier[0])) .offset(pageable.getOffset()) .limit(pageable.getPageSize() + 1) diff --git a/src/main/resources/application-db.yml b/src/main/resources/application-db.yml index 9136dd2e..260a6bff 100644 --- a/src/main/resources/application-db.yml +++ b/src/main/resources/application-db.yml @@ -27,8 +27,9 @@ jwt: spring: jpa: - hibernate: - default_batch_fetch_size: 100 + properties: + hibernate: + default_batch_fetch_size: 1000 --- # local 공통 설정 spring: