Interface PostRepo

All Superinterfaces:
org.springframework.data.repository.CrudRepository<PostEntity,Integer>, JpaRepository<PostEntity,Integer>, org.springframework.data.repository.ListCrudRepository<PostEntity,Integer>, org.springframework.data.repository.ListPagingAndSortingRepository<PostEntity,Integer>, org.springframework.data.repository.PagingAndSortingRepository<PostEntity,Integer>, org.springframework.data.repository.query.QueryByExampleExecutor<PostEntity>, org.springframework.data.repository.Repository<PostEntity,Integer>

public interface PostRepo extends JpaRepository<PostEntity,Integer>
  • Method Details

    • findAllPostsWithDetails

      @Query("SELECT p FROM PostEntity p JOIN FETCH p.postCategory JOIN FETCH p.postTag JOIN FETCH p.member") List<PostEntity> findAllPostsWithDetails()
    • findByMemberID

      List<PostEntity> findByMemberID(Integer memberID)
    • findByPostCategory_CategoryId

      org.springframework.data.domain.Page<PostEntity> findByPostCategory_CategoryId(Integer categoryId, org.springframework.data.domain.Pageable pageable)
    • findByPostCategory

      List<PostEntity> findByPostCategory(CategoryEntity postCategory)
    • findByCategoryTagAndKeyword

      @Query("SELECT p FROM PostEntity p WHERE p.postCategory.categoryId = :categoryId AND (:tagId IS NULL OR p.postTag.tagId = :tagId) AND (:keyword IS NULL OR p.postTitle LIKE %:keyword%)") org.springframework.data.domain.Page<PostEntity> findByCategoryTagAndKeyword(@Param("categoryId") Integer categoryId, @Param("tagId") Integer tagId, @Param("keyword") String keyword, org.springframework.data.domain.Pageable pageable)