Interface QuestionCommentJpaRepository

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

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

    • findByIdAndState

      Optional<QuestionComment> findByIdAndState(Integer commentIdx, BaseEntity.State state)
    • findAllByQuestionAndStateOrderByIdAsc

      List<QuestionComment> findAllByQuestionAndStateOrderByIdAsc(Question question, BaseEntity.State state)
    • findByIdAndStateWithPessimisticLock

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

      @Query(value="SELECT COUNT(*) > 0 FROM question_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)