Skip to content

Commit

Permalink
refactor: techStack- 관련 jpql distinct적용
Browse files Browse the repository at this point in the history
  • Loading branch information
starwook committed Sep 25, 2023
1 parent 50317ef commit a70400b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface ProjectRepository extends JpaRepository<Project, Long>, JpaSpec


Page<Project> findAll(Specification<Project> spec, Pageable pageable);
@Query(value = "select p from Project p join p.techStacks ts where ts in (:techStack)")
@Query(value = "select distinct p from Project p join p.techStacks ts where ts in (:techStack)")
List<Project> getRecommendedProject(@Param("techStack") Set<String> techStack);


Expand Down
3 changes: 2 additions & 1 deletion src/main/java/site/chagok/server/security/dto/SignUpDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import site.chagok.server.common.contstans.SocialType;

import java.util.List;
import java.util.Set;

@Getter
@Setter
Expand All @@ -25,5 +26,5 @@ public class SignUpDto {

@JsonProperty("skills")
@ApiModelProperty(notes = "사용자 기술스택")
private List<String> techStacks;
private Set<String> techStacks;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface StudyRepository extends JpaRepository<Study,Long>, JpaSpecifica



@Query("select s from Study s join s.techStacks ts where ts in (:techStack)")
@Query("select distinct s from Study s join s.techStacks ts where ts in (:techStack)")
List<Study> getRecommendedStudy(@Param("techStack") Set<String> techStack);

}

0 comments on commit a70400b

Please sign in to comment.