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 TypeMethodDescriptionfindAllByFromUserAndStatus
(User fromUser, FriendshipRequestStatus status) Выполняет поиск всех заявок с определенным статусов для пользователя, отправившего заявки.findAllByToUserAndStatus
(User toUser, FriendshipRequestStatus status) Выполняет поиск всех заявок с определенным статусов для пользователя, получившего заявки.findFriendshipRequestByFromUserAndToUser
(User fromUser, User toUser) Выполняет поиск заявки на дружбу в базе данных.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
Выполняет поиск заявки на дружбу в базе данных.- Parameters:
fromUser
- пользователь, отправивший заявку.toUser
- пользователь, заявка которому предназначается.- Returns:
- Optional, содержащий заявку, если её удалось найти, иначе пустой.
-
findAllByFromUserAndStatus
Выполняет поиск всех заявок с определенным статусов для пользователя, отправившего заявки.- Parameters:
fromUser
- пользователь, отправивший заявки.status
- статус заявок.- Returns:
- список заявок.
-
findAllByToUserAndStatus
Выполняет поиск всех заявок с определенным статусов для пользователя, получившего заявки.- Parameters:
toUser
- пользователь, получивший заявки.status
- статус заявок.- Returns:
- список заявок.
-