Interface LikesPostRepo

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

public interface LikesPostRepo extends JpaRepository<LikesEntity,Integer>
  • Method Details

    • findByMemberIDAndPostID

      LikesEntity findByMemberIDAndPostID(Integer memberID, Integer postID)
    • findLikesByMember

      @Query("SELECT new map(p.postID as postID, p.postTitle as title, p.postContent as content, l.likeCreatedTime as Date) FROM LikesEntity l JOIN PostEntity p ON l.postID = p.postID WHERE l.memberID = :memberID") List<Map<String,Object>> findLikesByMember(Integer memberID)
    • deleteByPostId

      @Modifying @Transactional @Query("DELETE FROM LikesEntity l WHERE l.postID = :postID") void deleteByPostId(@Param("postID") Integer postID)
    • existsByMemberIDAndPostID

      boolean existsByMemberIDAndPostID(Integer memberID, Integer postID)
    • countByPostID

      Integer countByPostID(Integer postID)