Interface WatchlistItemRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<WatchlistItem, Long>, org.springframework.data.jpa.repository.JpaRepository<WatchlistItem, Long>, org.springframework.data.repository.ListCrudRepository<WatchlistItem, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<WatchlistItem, Long>, org.springframework.data.repository.PagingAndSortingRepository<WatchlistItem, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<WatchlistItem>, org.springframework.data.repository.Repository<WatchlistItem, Long>
@Repository
public interface WatchlistItemRepository
extends org.springframework.data.jpa.repository.JpaRepository<WatchlistItem, Long>
Data-access layer for
WatchlistItem.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteWatchlistItemById(Long watchlistItemId) Deletes aWatchlistItemmatching the given id.voiddeleteWatchlistItemsByWatchlistId(Long watchlistId) Deletes allWatchlistItems matching the given watchlist id.findByIdAndWatchlistUserId(Long id, Long userId) Returns a watchlist item matching the decoded UID and authenticated owner.findWatchlistItemByWatchlistAndSymbol(Watchlist watchlist, Symbol symbol) Returns theWatchlistItemmatching the given watchlist and symbol.findWatchlistItemsByPreferredSymbolAlias(SymbolAlias preferredSymbolAlias) Returns allWatchlistItems matching the given preferred alias.findWatchlistItemsBySymbol(Symbol symbol) Returns allWatchlistItems matching the given symbol.findWatchlistItemsByWatchlist(Watchlist watchlist) Returns allWatchlistItems matching the given watchlist.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByIdAndWatchlistUserId
Returns a watchlist item matching the decoded UID and authenticated owner.- Parameters:
id- watchlist item id decoded from its UIDuserId- owning user id- Returns:
OptionalofWatchlistItem
-
findWatchlistItemByWatchlistAndSymbol
Returns theWatchlistItemmatching the given watchlist and symbol.- Parameters:
watchlist-Watchlistsymbol-Symbol- Returns:
WatchlistItem
-
findWatchlistItemsByWatchlist
Returns allWatchlistItems matching the given watchlist.- Parameters:
watchlist-Watchlist- Returns:
ListofWatchlistItem
-
findWatchlistItemsBySymbol
Returns allWatchlistItems matching the given symbol.- Parameters:
symbol-Symbol- Returns:
ListofWatchlistItem
-
findWatchlistItemsByPreferredSymbolAlias
Returns allWatchlistItems matching the given preferred alias.- Parameters:
preferredSymbolAlias-SymbolAlias- Returns:
ListofWatchlistItem
-
deleteWatchlistItemById
@Modifying(flushAutomatically=true) @Query("delete from WatchlistItem watchlistItem where watchlistItem.id = :watchlistItemId") void deleteWatchlistItemById(@Param("watchlistItemId") Long watchlistItemId) Deletes aWatchlistItemmatching the given id.- Parameters:
watchlistItemId- watchlist item id
-
deleteWatchlistItemsByWatchlistId
@Modifying(flushAutomatically=true) @Query("delete from WatchlistItem watchlistItem where watchlistItem.watchlist.id = :watchlistId") void deleteWatchlistItemsByWatchlistId(@Param("watchlistId") Long watchlistId) Deletes allWatchlistItems matching the given watchlist id.- Parameters:
watchlistId- watchlist id
-