Interface ChatRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Chat,​java.lang.String>, org.springframework.data.mongodb.repository.MongoRepository<Chat,​java.lang.String>, org.springframework.data.repository.PagingAndSortingRepository<Chat,​java.lang.String>, org.springframework.data.repository.query.QueryByExampleExecutor<Chat>, org.springframework.data.repository.Repository<Chat,​java.lang.String>

    @Repository
    public interface ChatRepository
    extends org.springframework.data.mongodb.repository.MongoRepository<Chat,​java.lang.String>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteById​(java.lang.String s)  
      java.util.List<Chat> findByFromId​(java.lang.String profileId)  
      java.util.List<Chat> findByGroupEntityId​(java.lang.String groupEntityId)  
      java.util.Optional<Chat> findById​(java.lang.String s)  
      java.util.List<Chat> findByToId​(java.lang.String profileId)  
      <S extends Chat>
      S
      insert​(S entity)  
      <S extends Chat>
      S
      save​(S entity)  
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteAllById, existsById, findAllById
      • Methods inherited from interface org.springframework.data.mongodb.repository.MongoRepository

        findAll, findAll, findAll, findAll, insert, saveAll
      • 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 Detail

      • insert

        @CacheEvict(value={"chatsFrom","chatsTo","groupChats"},
                    allEntries=true)
        <S extends Chat> S insert​(S entity)
        Specified by:
        insert in interface org.springframework.data.mongodb.repository.MongoRepository<Chat,​java.lang.String>
      • save

        @CacheEvict(value={"chatsFrom","chatsTo","groupChats"},
                    allEntries=true)
        <S extends Chat> S save​(S entity)
        Specified by:
        save in interface org.springframework.data.repository.CrudRepository<Chat,​java.lang.String>
      • deleteById

        @CacheEvict(value={"chatsFrom","chatsTo","groupChats"},
                    allEntries=true)
        void deleteById​(java.lang.String s)
        Specified by:
        deleteById in interface org.springframework.data.repository.CrudRepository<Chat,​java.lang.String>
      • findById

        @Cacheable({"chatsFrom","chatsTo","groupChats"})
        java.util.Optional<Chat> findById​(java.lang.String s)
        Specified by:
        findById in interface org.springframework.data.repository.CrudRepository<Chat,​java.lang.String>
      • findByFromId

        @Cacheable("chatsFrom")
        java.util.List<Chat> findByFromId​(java.lang.String profileId)
      • findByToId

        @Cacheable("chatsTo")
        java.util.List<Chat> findByToId​(java.lang.String profileId)
      • findByGroupEntityId

        @Cacheable("groupChats")
        java.util.List<Chat> findByGroupEntityId​(java.lang.String groupEntityId)