From 29532e65e23eccd73ac5903bbd2441fce4724cf4 Mon Sep 17 00:00:00 2001 From: halin Date: Thu, 8 Jun 2023 21:51:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=95=88=20=EC=93=B0=EB=8A=94=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../post/service/PostSpecification.java | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 backend/src/main/java/com/rising/backend/domain/post/service/PostSpecification.java diff --git a/backend/src/main/java/com/rising/backend/domain/post/service/PostSpecification.java b/backend/src/main/java/com/rising/backend/domain/post/service/PostSpecification.java deleted file mode 100644 index 2e1941d..0000000 --- a/backend/src/main/java/com/rising/backend/domain/post/service/PostSpecification.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.rising.backend.domain.post.service; - -import com.rising.backend.domain.post.domain.Post; -import com.rising.backend.domain.post.domain.PostType; -import org.springframework.data.jpa.domain.Specification; - -import javax.persistence.criteria.Predicate; -import java.util.ArrayList; -import java.util.List; - -public class PostSpecification { - public static Specification searchWith(final PostType postType) { - - return ((root, query, builder) -> { - List predicates = new ArrayList<>(); - if (postType != null) { - predicates.add(builder.equal(root.get("postType"), postType)); - } - return builder.and(predicates.toArray(new Predicate[0])); - }); - } -}