Correction of sql query.

This commit is contained in:
2018-05-21 00:07:31 +02:00
parent f55c6aa23b
commit 8706c60b9f

View File

@@ -19,7 +19,7 @@ public interface PostRepository extends CrudRepository<Post, Long>, PostSearchRe
nativeQuery = true) nativeQuery = true)
List<Post> getLast(@Param("limit") final Integer pLimit); List<Post> getLast(@Param("limit") final Integer pLimit);
@Query(value = "SELECT * FROM post p WHERE category_id = :categoryId ORDER BY creation_date DESC", @Query(value = "SELECT * FROM post p INNER JOIN \"user\" u ON u.id = creator_id WHERE category_id = :categoryId ORDER BY creation_date DESC",
nativeQuery = true) nativeQuery = true)
List<Post> getByCategoryId(@Param("categoryId") final Long pCategoryId); List<Post> getByCategoryId(@Param("categoryId") final Long pCategoryId);