Package com.bytedesk.core.message
Interface MessageRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<MessageEntity,
,Long> org.springframework.data.jpa.repository.JpaRepository<MessageEntity,
,Long> org.springframework.data.jpa.repository.JpaSpecificationExecutor<MessageEntity>
,org.springframework.data.repository.ListCrudRepository<MessageEntity,
,Long> org.springframework.data.repository.ListPagingAndSortingRepository<MessageEntity,
,Long> org.springframework.data.repository.PagingAndSortingRepository<MessageEntity,
,Long> org.springframework.data.repository.query.QueryByExampleExecutor<MessageEntity>
,org.springframework.data.repository.Repository<MessageEntity,
Long>
public interface MessageRepository
extends org.springframework.data.jpa.repository.JpaRepository<MessageEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<MessageEntity>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T extends Object>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
existsByUid
(String uid) findByThread_UidAndStatusInOrderByCreatedAtAsc
(String threadUid, List<String> statuses) 根据会话UID和状态列表查询消息,按创建时间升序排列findByThread_UidOrderByCreatedAtAsc
(String threadUid) findFirstByThread_UidAndTypeAndUserContainsOrderByCreatedAtDesc
(String threadUid, String type, String userUid) findFirstByThread_UidOrderByCreatedAtDesc
(String threadUid) findLatestByThreadTopicOrderByCreatedAtDesc
(String threadTopic, org.springframework.data.domain.Pageable pageable) findTransferMessage
(String type, String messageUid) 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, 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
-
findTransferMessage
@Query("SELECT m FROM MessageEntity m WHERE m.type = :type AND m.content LIKE %:messageUid%") Optional<MessageEntity> findTransferMessage(@Param("type") String type, @Param("messageUid") String messageUid) -
findFirstByThread_UidOrderByCreatedAtDesc
-
findByThread_UidOrderByCreatedAtAsc
-
findLatestByThreadTopicOrderByCreatedAtDesc
@Query("SELECT m FROM MessageEntity m WHERE m.thread.topic = :threadTopic ORDER BY m.createdAt DESC") List<MessageEntity> findLatestByThreadTopicOrderByCreatedAtDesc(@Param("threadTopic") String threadTopic, org.springframework.data.domain.Pageable pageable) -
findFirstByThread_UidAndTypeAndUserContainsOrderByCreatedAtDesc
Optional<MessageEntity> findFirstByThread_UidAndTypeAndUserContainsOrderByCreatedAtDesc(@Param("threadUid") String threadUid, @Param("type") String type, @Param("userUid") String userUid) -
findByThread_UidAndStatusInOrderByCreatedAtAsc
List<MessageEntity> findByThread_UidAndStatusInOrderByCreatedAtAsc(String threadUid, List<String> statuses) 根据会话UID和状态列表查询消息,按创建时间升序排列- Parameters:
threadUid
- 会话UIDstatuses
- 状态列表- Returns:
- 消息列表
-
existsByUid
-