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
countByTopicAndStateAndDeletedFalse
(String topic, String state) existsByUid
(String uid) org.springframework.data.domain.Page<ThreadEntity>
findByOwnerAndHideAndDeleted
(UserEntity owner, Boolean hide, Boolean deleted, org.springframework.data.domain.Pageable pageable) findByStateAndDeleted
(String state, Boolean deleted) findByStatesAndDeleted
(List<String> states, Boolean deleted) findByTopicAndDeleted
(String topic, Boolean deleted) findByTypesInAndStateAndDeletedFalse
(List<String> types, String state) findByTypesInAndStateNotAndDeletedFalse
(List<String> types, String state) findFirstByTopic
(String topic) findFirstByTopicAndDeletedOrderByCreatedAtDesc
(String topic, Boolean deleted) findFirstByTopicAndOwnerAndDeletedOrderByUpdatedAtDesc
(String topic, UserEntity owner, Boolean deleted) used for member thread typefindFirstByTopicAndStateNotContainingAndDeleted
(String topic, String state, Boolean deleted) findTopicAndStatesNotInAndDeleted
(String topicWithWildcard, List<String> states, 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) -
findFirstByTopicAndStateNotContainingAndDeleted
Optional<ThreadEntity> findFirstByTopicAndStateNotContainingAndDeleted(String topic, String state, Boolean deleted) -
findTopicAndStatesNotInAndDeleted
-
findByOwnerAndHideAndDeleted
org.springframework.data.domain.Page<ThreadEntity> findByOwnerAndHideAndDeleted(UserEntity owner, Boolean hide, Boolean deleted, org.springframework.data.domain.Pageable pageable) -
findFirstByTopic
-
findByStateAndDeleted
-
findByStatesAndDeleted
@Query("SELECT t FROM ThreadEntity t WHERE t.state IN :states AND t.deleted = :deleted") List<ThreadEntity> findByStatesAndDeleted(@Param("states") List<String> states, Boolean deleted) -
findByTypesInAndStatesNotInAndDeleted
-
findByTypesInAndStateAndDeletedFalse
@Query("SELECT t FROM ThreadEntity t WHERE t.type IN :types AND t.state = :state AND t.deleted = false") List<ThreadEntity> findByTypesInAndStateAndDeletedFalse(@Param("types") List<String> types, @Param("state") String state) -
findByTypesInAndStateNotAndDeletedFalse
@Query("SELECT t FROM ThreadEntity t WHERE t.type IN :types AND t.state != :state AND t.deleted = false") List<ThreadEntity> findByTypesInAndStateNotAndDeletedFalse(@Param("types") List<String> types, @Param("state") String state) -
countByTopicAndStateAndDeletedFalse
-