Interface FriendshipRequestRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<FriendshipRequest,Long>, org.springframework.data.jpa.repository.JpaRepository<FriendshipRequest,Long>, org.springframework.data.repository.ListCrudRepository<FriendshipRequest,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<FriendshipRequest,Long>, org.springframework.data.repository.PagingAndSortingRepository<FriendshipRequest,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<FriendshipRequest>, org.springframework.data.repository.Repository<FriendshipRequest,Long>

@Repository public interface FriendshipRequestRepository extends org.springframework.data.jpa.repository.JpaRepository<FriendshipRequest,Long>
Интерфейс представляет собой функциональность взаимодействия объекта FriendshipRequest с базой данных.
Author:
mrGreenNV
  • Method Summary

    Modifier and Type
    Method
    Description
    Выполняет поиск всех заявок с определенным статусов для пользователя, отправившего заявки.
    Выполняет поиск всех заявок с определенным статусов для пользователя, получившего заявки.
    Выполняет поиск заявки на дружбу в базе данных.

    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.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

    • findFriendshipRequestByFromUserAndToUser

      Optional<FriendshipRequest> findFriendshipRequestByFromUserAndToUser(User fromUser, User toUser)
      Выполняет поиск заявки на дружбу в базе данных.
      Parameters:
      fromUser - пользователь, отправивший заявку.
      toUser - пользователь, заявка которому предназначается.
      Returns:
      Optional, содержащий заявку, если её удалось найти, иначе пустой.
    • findAllByFromUserAndStatus

      List<FriendshipRequest> findAllByFromUserAndStatus(User fromUser, FriendshipRequestStatus status)
      Выполняет поиск всех заявок с определенным статусов для пользователя, отправившего заявки.
      Parameters:
      fromUser - пользователь, отправивший заявки.
      status - статус заявок.
      Returns:
      список заявок.
    • findAllByToUserAndStatus

      List<FriendshipRequest> findAllByToUserAndStatus(User toUser, FriendshipRequestStatus status)
      Выполняет поиск всех заявок с определенным статусов для пользователя, получившего заявки.
      Parameters:
      toUser - пользователь, получивший заявки.
      status - статус заявок.
      Returns:
      список заявок.