Interface WatchlistRepository

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

@Repository public interface WatchlistRepository extends org.springframework.data.jpa.repository.JpaRepository<Watchlist, Long>
Data-access layer for Watchlist.
Version:
3.0.6
Author:
Stephen Prizio
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes a Watchlist matching the given id.
    Returns all Watchlists for the given User.
    Returns a watchlist matching the decoded UID and authenticated owner.
    Returns a Watchlist for the given User and name.

    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

    • findByIdAndUserId

      Optional<Watchlist> findByIdAndUserId(Long id, Long userId)
      Returns a watchlist matching the decoded UID and authenticated owner.
      Parameters:
      id - watchlist id decoded from its UID
      userId - owning user id
      Returns:
      Optional of Watchlist
    • findAllByUser

      List<Watchlist> findAllByUser(User user)
      Returns all Watchlists for the given User.
      Parameters:
      user - User
      Returns:
      List of Watchlist
    • findWatchlistByUserAndName

      Watchlist findWatchlistByUserAndName(User user, String name)
      Returns a Watchlist for the given User and name.
      Parameters:
      user - User
      name - watchlist name
      Returns:
      Watchlist
    • deleteWatchlistById

      @Modifying(flushAutomatically=true) @Query("delete from Watchlist watchlist where watchlist.id = :watchlistId") void deleteWatchlistById(@Param("watchlistId") Long watchlistId)
      Deletes a Watchlist matching the given id.
      Parameters:
      watchlistId - watchlist id