Interface ThreadRepository

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

@Repository public interface ThreadRepository extends org.springframework.data.jpa.repository.JpaRepository<ThreadEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<ThreadEntity>
  • Method Details

    • findByUid

      Optional<ThreadEntity> findByUid(String uid)
    • existsByUid

      Boolean existsByUid(String uid)
    • findFirstByTopicAndOwnerAndDeletedOrderByUpdatedAtDesc

      Optional<ThreadEntity> findFirstByTopicAndOwnerAndDeletedOrderByUpdatedAtDesc(String topic, UserEntity owner, Boolean deleted)
      used for member thread type
    • findByTopicAndDeleted

      List<ThreadEntity> findByTopicAndDeleted(String topic, Boolean deleted)
    • findFirstByTopicAndDeletedOrderByCreatedAtDesc

      Optional<ThreadEntity> findFirstByTopicAndDeletedOrderByCreatedAtDesc(String topic, Boolean deleted)
    • findFirstByTopicAndStatusNotContainingAndDeleted

      Optional<ThreadEntity> findFirstByTopicAndStatusNotContainingAndDeleted(String topic, String status, Boolean deleted)
    • findTopicAndStatusesNotInAndDeleted

      @Query(value="select * from core_thread t where t.topic = ?1 and t.status not in ?2 and t.is_deleted = ?3 LIMIT 1", nativeQuery=true) Optional<ThreadEntity> findTopicAndStatusesNotInAndDeleted(String topicWithWildcard, List<String> statuses, Boolean deleted)
    • findByOwnerAndHideAndDeleted

      org.springframework.data.domain.Page<ThreadEntity> findByOwnerAndHideAndDeleted(UserEntity owner, Boolean hide, Boolean deleted, org.springframework.data.domain.Pageable pageable)
    • findFirstByTopic

      List<ThreadEntity> findFirstByTopic(String topic)
    • findByStatusAndDeleted

      List<ThreadEntity> findByStatusAndDeleted(String status, Boolean deleted)
    • findByStatusesAndDeleted

      @Query("SELECT t FROM ThreadEntity t WHERE t.status IN :statuses AND t.deleted = :deleted") List<ThreadEntity> findByStatusesAndDeleted(@Param("statuses") List<String> statuses, Boolean deleted)
    • findByTypesInAndStatusesNotInAndDeleted

      @Query("SELECT t FROM ThreadEntity t WHERE t.type IN :types AND t.status not IN :statuses AND t.deleted = :deleted") List<ThreadEntity> findByTypesInAndStatusesNotInAndDeleted(@Param("types") List<String> types, @Param("statuses") List<String> statuses, Boolean deleted)
    • findByTypesInAndStatusAndDeletedFalse

      @Query("SELECT t FROM ThreadEntity t WHERE t.type IN :types AND t.status = :status AND t.deleted = false") List<ThreadEntity> findByTypesInAndStatusAndDeletedFalse(@Param("types") List<String> types, @Param("status") String status)
    • findByTypesInAndStatusNotAndDeletedFalse

      @Query("SELECT t FROM ThreadEntity t WHERE t.type IN :types AND t.status != :status AND t.deleted = false") List<ThreadEntity> findByTypesInAndStatusNotAndDeletedFalse(@Param("types") List<String> types, @Param("status") String status)
    • countByTopicAndStatusAndDeletedFalse

      @Query("SELECT COUNT(*) FROM ThreadEntity t WHERE t.topic = :topic AND t.status = :status AND t.deleted = false") int countByTopicAndStatusAndDeletedFalse(@Param("topic") String topic, @Param("status") String status)
    • countByTopicAndStatusNotAndDeletedFalse

      @Query("SELECT COUNT(*) FROM ThreadEntity t WHERE t.topic = :topic AND t.status != :status AND t.deleted = false") int countByTopicAndStatusNotAndDeletedFalse(@Param("topic") String topic, @Param("status") String status)
    • findByTopicAndStatusNotAndDeletedFalse

      @Query("SELECT t FROM ThreadEntity t WHERE t.topic = :topic AND t.status != :status AND t.deleted = false") List<ThreadEntity> findByTopicAndStatusNotAndDeletedFalse(@Param("topic") String topic, @Param("status") String status)