11.09save
This commit is contained in:
@@ -2,6 +2,7 @@ package com.io.realworld.domain.aggregate.article.repository;
|
||||
|
||||
import com.io.realworld.domain.aggregate.article.entity.Article;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.EntityGraph;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
@@ -10,6 +11,7 @@ import java.util.List;
|
||||
public interface ArticleRepository extends JpaRepository<Article,Long> {
|
||||
|
||||
|
||||
@EntityGraph(attributePaths = "tags")
|
||||
@Query("SELECT a FROM Article a JOIN Tag t ON a.id = t.article.id")
|
||||
List<Article> findByTag(String tag, Pageable pageable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user