Package com.bytedesk.core.thread
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 Summary
Modifier and TypeMethodDescriptionint
countByTopicAndStatusAndDeletedFalse
(String topic, String status) int
countByTopicAndStatusNotAndDeletedFalse
(String topic, String status) existsByUid
(String uid) org.springframework.data.domain.Page<ThreadEntity>
findByOwnerAndHideAndDeleted
(UserEntity owner, Boolean hide, Boolean deleted, org.springframework.data.domain.Pageable pageable) findByStatusAndDeleted
(String status, Boolean deleted) findByStatusesAndDeleted
(List<String> statuses, Boolean deleted) findByTopicAndDeleted
(String topic, Boolean deleted) findByTopicAndStatusNotAndDeletedFalse
(String topic, String status) findByTypesInAndStatusAndDeletedFalse
(List<String> types, String status) findByTypesInAndStatusNotAndDeletedFalse
(List<String> types, String status) findFirstByTopic
(String topic) findFirstByTopicAndDeletedOrderByCreatedAtDesc
(String topic, Boolean deleted) findFirstByTopicAndOwnerAndDeletedOrderByUpdatedAtDesc
(String topic, UserEntity owner, Boolean deleted) used for member thread typefindFirstByTopicAndStatusNotContainingAndDeleted
(String topic, String status, Boolean deleted) findTopicAndStatusesNotInAndDeleted
(String topicWithWildcard, List<String> statuses, Boolean deleted) 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.jpa.repository.JpaSpecificationExecutor
count, delete, exists, findAll, findAll, findAll, findBy, findOne
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
-
findByUid
-
existsByUid
-
findFirstByTopicAndOwnerAndDeletedOrderByUpdatedAtDesc
Optional<ThreadEntity> findFirstByTopicAndOwnerAndDeletedOrderByUpdatedAtDesc(String topic, UserEntity owner, Boolean deleted) used for member thread type -
findByTopicAndDeleted
-
findFirstByTopicAndDeletedOrderByCreatedAtDesc
Optional<ThreadEntity> findFirstByTopicAndDeletedOrderByCreatedAtDesc(String topic, Boolean deleted) -
findFirstByTopicAndStatusNotContainingAndDeleted
Optional<ThreadEntity> findFirstByTopicAndStatusNotContainingAndDeleted(String topic, String status, Boolean deleted) -
findTopicAndStatusesNotInAndDeleted
-
findByOwnerAndHideAndDeleted
org.springframework.data.domain.Page<ThreadEntity> findByOwnerAndHideAndDeleted(UserEntity owner, Boolean hide, Boolean deleted, org.springframework.data.domain.Pageable pageable) -
findFirstByTopic
-
findByStatusAndDeleted
-
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
-
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
-
countByTopicAndStatusNotAndDeletedFalse
-
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)
-