Interface SubscriptionRepository

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

@Repository public interface SubscriptionRepository extends org.springframework.data.jpa.repository.JpaRepository<Subscription,Long>
Интерфейс представляет собой функциональность взаимодействия объекта Subscription с базой данных.
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

    • findSubscriptionByUserAndSubscriptionUser

      Optional<Subscription> findSubscriptionByUserAndSubscriptionUser(User user, User subscriptionUser)
      Выполняет поиск подписки в базе данных.
      Parameters:
      user - пользователь.
      subscriptionUser - подписка пользователя.
      Returns:
      Optional содержащий подписку, если она была найдена, иначе - пустой.
    • findAllByUser

      List<Subscription> findAllByUser(User user)
      Выполняет поиск всех подписок пользователя.
      Parameters:
      user - пользователь.
      Returns:
      список подписок.