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>
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<PostEntity> findByCategoryTagAndKeyword(Integer categoryId, Integer tagId, String keyword, org.springframework.data.domain.Pageable pageable) findByMemberID(Integer memberID) findByPostCategory(CategoryEntity postCategory) org.springframework.data.domain.Page<PostEntity> findByPostCategory_CategoryId(Integer categoryId, org.springframework.data.domain.Pageable pageable) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
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
-
findByPostCategory_CategoryId
org.springframework.data.domain.Page<PostEntity> findByPostCategory_CategoryId(Integer categoryId, org.springframework.data.domain.Pageable pageable) -
findByPostCategory
-
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)
-