Interface ChatMessageRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ChatMessage,Long>, org.springframework.data.repository.Repository<ChatMessage,Long>

@Repository public interface ChatMessageRepository extends org.springframework.data.repository.CrudRepository<ChatMessage,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<ChatMessage>
    findAllByCommonsId(Long commonsId, org.springframework.data.domain.Pageable pageable)
     
    org.springframework.data.domain.Page<ChatMessage>
    findByCommonsId(Long commonsId, org.springframework.data.domain.Pageable pageable)
     
    org.springframework.data.domain.Page<ChatMessage>
    findByCommonsIdAndHidden(Long commonsId, org.springframework.data.domain.Pageable pageable)
     
    findById(long id)
     

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll
  • Method Details

    • findByCommonsId

      @Query("SELECT cm FROM chat_message cm WHERE cm.commonsId = :commonsId AND cm.hidden = false") org.springframework.data.domain.Page<ChatMessage> findByCommonsId(Long commonsId, org.springframework.data.domain.Pageable pageable)
    • findAllByCommonsId

      @Query("SELECT cm FROM chat_message cm WHERE cm.commonsId = :commonsId") org.springframework.data.domain.Page<ChatMessage> findAllByCommonsId(Long commonsId, org.springframework.data.domain.Pageable pageable)
    • findByCommonsIdAndHidden

      @Query("SELECT cm FROM chat_message cm WHERE cm.commonsId = :commonsId AND cm.hidden = true") org.springframework.data.domain.Page<ChatMessage> findByCommonsIdAndHidden(Long commonsId, org.springframework.data.domain.Pageable pageable)
    • findById

      @Query("SELECT cm FROM chat_message cm WHERE cm.id = :id") Optional<ChatMessage> findById(long id)