-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(BoardHashtagRepository): SQL문에 개행추가, customRepository에서 JPQL…
…로 작성한 내용을 어노테이션으로 수정
- Loading branch information
1 parent
1527242
commit 0a53dd5
Showing
8 changed files
with
22 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 15 additions & 2 deletions
17
.../page/clab/api/domain/community/board/adapter/out/persistence/BoardHashtagRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
package page.clab.api.domain.community.board.adapter.out.persistence; | ||
|
||
import java.util.List; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.querydsl.QuerydslPredicateExecutor; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface BoardHashtagRepository extends JpaRepository<BoardHashtagJpaEntity, Long>, BoardHashtagRepositoryCustom, QuerydslPredicateExecutor<BoardHashtagJpaEntity> { | ||
public interface BoardHashtagRepository extends JpaRepository<BoardHashtagJpaEntity, Long>{ | ||
|
||
List<BoardHashtagJpaEntity> findAllByBoardId(Long boardId); | ||
|
||
@Query(value = "SELECT b.* FROM board_hashtag b WHERE b.board_id = :boardId", nativeQuery = true) | ||
@Query(value = "SELECT b.* " + | ||
"FROM board_hashtag b " + | ||
"WHERE b.board_id = :boardId", | ||
nativeQuery = true) | ||
List<BoardHashtagJpaEntity> findAllIncludingDeletedByBoardId(Long boardId); | ||
|
||
@Query("SELECT DISTINCT b.boardId " + | ||
"FROM BoardHashtagJpaEntity b " + | ||
"WHERE b.hashtagId IN :hashtagIds " + | ||
"AND b.isDeleted = false " + | ||
"GROUP BY b.boardId " + | ||
"HAVING COUNT(b.hashtagId) = :size") | ||
List<Long> getBoardIdsByHashTagId(@Param("hashtagIds") List<Long> hashtagIds, @Param("size") Long size); | ||
} |
9 changes: 0 additions & 9 deletions
9
...clab/api/domain/community/board/adapter/out/persistence/BoardHashtagRepositoryCustom.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
...e/clab/api/domain/community/board/adapter/out/persistence/BoardHashtagRepositoryImpl.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters