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>
@Repository
public interface MessageRepository
extends org.springframework.data.jpa.repository.JpaRepository<MessageEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<MessageEntity>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
existsByUid
(String uid) findFirstByThread_UidAndTypeAndUserContainsOrderByCreatedAtDesc
(String threadUid, String type, String userUid) findFirstByThread_UidOrderByCreatedAtDesc
(String threadUid) 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, 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
Optional<MessageEntity> findFirstByThread_UidOrderByCreatedAtDesc(@Param("threadUid") String threadUid) -
findFirstByThread_UidAndTypeAndUserContainsOrderByCreatedAtDesc
Optional<MessageEntity> findFirstByThread_UidAndTypeAndUserContainsOrderByCreatedAtDesc(@Param("threadUid") String threadUid, @Param("type") String type, @Param("userUid") String userUid) -
existsByUid
-