-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 태그 엔티티 추가 - PostTag 엔티티 추가 - RootTag 엔티티 추가 - UserTag 엔티티 추가 - User 연관 관계 수정 - Post 연관 관계 수정 * feat: 태그 레포지터리 추가 - UserTagRepository - PostTagRepository - RootTagRepository * feat: tag 서비스, 컨트롤러 기능 구현 - UserTag - PostTag - RootTag * test: 태그 테스트 추가 * add: V2.1 Tag 추가
- Loading branch information
Showing
30 changed files
with
946 additions
and
99 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
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
20 changes: 20 additions & 0 deletions
20
src/main/java/com/prgrms/prolog/domain/post/repository/PostRepository.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,8 +1,28 @@ | ||
package com.prgrms.prolog.domain.post.repository; | ||
|
||
import java.util.Optional; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import com.prgrms.prolog.domain.post.model.Post; | ||
|
||
public interface PostRepository extends JpaRepository<Post, Long> { | ||
|
||
@Query(""" | ||
SELECT p | ||
FROM Post p | ||
LEFT JOIN FETCH p.comments c | ||
where p.id = :postId | ||
""") | ||
Optional<Post> joinCommentFindById(@Param(value = "postId") Long postId); | ||
|
||
@Query(""" | ||
SELECT p | ||
FROM Post p | ||
LEFT JOIN FETCH p.user | ||
WHERE p.id = :postId | ||
""") | ||
Optional<Post> joinUserFindById(@Param(value = "postId") Long postId); | ||
} |
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
Oops, something went wrong.