Interface QuestionReplyCommentJpaRepository

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

public interface QuestionReplyCommentJpaRepository extends org.springframework.data.jpa.repository.JpaRepository<QuestionReplyComment,Integer>
QuestionReplyCommentJpaRepository는 QuestionReplyComment 엔티티에 대한 데이터 액세스 기능을 제공.
  • Method Summary

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByIdAndState

      Optional<QuestionReplyComment> findByIdAndState(Integer commentIdx, BaseEntity.State state)
    • existsByQuestionCommentAndState

      boolean existsByQuestionCommentAndState(QuestionComment questionComment, BaseEntity.State state)
    • findByIdAndStateWithPessimisticLock

      @Lock(PESSIMISTIC_WRITE) @QueryHints() @Query("SELECT c FROM QuestionReplyComment c WHERE c.id = :commentIdx AND c.state = :state") Optional<QuestionReplyComment> findByIdAndStateWithPessimisticLock(Integer commentIdx, BaseEntity.State state)
    • existsByUserIdAndQuestionIdAndDeletedatIsNull

      @Query(value="SELECT COUNT(*) > 0 FROM question_reply_comment_tb WHERE user_id = :userId AND question_id = :questionId AND deletedat IS NULL", nativeQuery=true) boolean existsByUserIdAndQuestionIdAndDeletedatIsNull(@Param("userId") Integer userId, @Param("questionId") Integer questionId)