fix : disable SQL

This commit is contained in:
minseokkang
2022-11-09 17:40:35 +09:00
parent ec029964d9
commit 0f9fcf38bf
2 changed files with 3 additions and 4 deletions

View File

@@ -11,12 +11,12 @@ import java.util.List;
public interface ArticleRepository extends JpaRepository<Article,Long> {
@EntityGraph(attributePaths = "tagList")
@Query("SELECT a FROM Article a JOIN Tag t ON a.id = t.article.id")
@Query("SELECT a FROM Article a JOIN Tag t ON a.id = t.article.id ORDER BY a.createdDate DESC")
List<Article> findByTag(String tag, Pageable pageable);
@Query("SELECT a FROM Article a WHERE a.author.username = :author")
@Query("SELECT a FROM Article a WHERE a.author.username = :author ORDER BY a.createdDate DESC")
List<Article> findByAuthorName(String author, Pageable pageable);
@Query("SELECT a FROM Article a LEFT JOIN Favorite f ON f.article.id = a.id WHERE f.user.username =:username")
@Query("SELECT a FROM Article a LEFT JOIN Favorite f ON f.article.id = a.id WHERE f.user.username =:username ORDER BY a.createdDate DESC")
List<Article> findByFavoritedUser(String username, Pageable pageable);
}

View File

@@ -10,7 +10,6 @@ spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.format_sql=true
spring.jpq.show-sql=true
spring.jpa.properties.hibernate.show_sql=true
#secret