Class WatchlistItemService
java.lang.Object
com.bluebell.greenhouse.radicle.services.AbstractGenericEntityService<WatchlistItem, WatchlistItemRepository>
com.bluebell.greenhouse.radicle.services.watchlist.WatchlistItemService
@Service("watchlistItemService")
@Transactional(readOnly=true)
public class WatchlistItemService
extends AbstractGenericEntityService<WatchlistItem, WatchlistItemRepository>
Service-layer for
WatchlistItem.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
ConstructorsConstructorDescriptionWatchlistItemService(WatchlistItemRepository watchlistItemRepository, jakarta.persistence.EntityManager entityManager) Creates the service. -
Method Summary
Modifier and TypeMethodDescriptionaddWatchlistItem(Watchlist watchlist, Symbol symbol, SymbolAlias preferredSymbolAlias) Creates a newWatchlistItem.voidclearPreferredSymbolAlias(SymbolAlias symbolAlias) Clears preferred alias references that point to the givenSymbolAlias.booleandeleteWatchlistItem(WatchlistItem watchlistItem) Deletes the givenWatchlistItem.voiddeleteWatchlistItemsBySymbol(Symbol symbol) Deletes all watchlist items referencing the givenSymbol.Returns aWatchlistItemfor the given uid.findWatchlistItemByUidAndUser(String uid, User user) Returns aWatchlistItemfor the given uid owned by the givenUser.findWatchlistItemsForWatchlist(Watchlist watchlist) Returns allWatchlistItems for the givenWatchlist.Resolves the watchlist item a reference identifies.updateWatchlistItem(WatchlistItem watchlistItem, SymbolAlias preferredSymbolAlias) Updates an existingWatchlistItem.Methods inherited from class AbstractGenericEntityService
refreshEntity, resolveEntity, resolveEntity, resolveEntity
-
Constructor Details
-
WatchlistItemService
public WatchlistItemService(WatchlistItemRepository watchlistItemRepository, jakarta.persistence.EntityManager entityManager) Creates the service.- Parameters:
watchlistItemRepository-WatchlistItemRepositoryentityManager-EntityManager
-
-
Method Details
-
resolveOwned
Resolves the watchlist item a reference identifies.- Parameters:
ref-OwnedWatchlistItemRef- Returns:
WatchlistItem
-
findWatchlistItemsForWatchlist
Returns allWatchlistItems for the givenWatchlist.- Parameters:
watchlist-Watchlist- Returns:
ListofWatchlistItem
-
findWatchlistItemByUid
Returns aWatchlistItemfor the given uid.- Parameters:
uid- uid- Returns:
- optional
WatchlistItem
-
findWatchlistItemByUidAndUser
Returns aWatchlistItemfor the given uid owned by the givenUser.- Parameters:
uid- uiduser-User- Returns:
- optional
WatchlistItem
-
addWatchlistItem
@Transactional public WatchlistItem addWatchlistItem(Watchlist watchlist, Symbol symbol, SymbolAlias preferredSymbolAlias) Creates a newWatchlistItem.- Parameters:
watchlist-Watchlistsymbol-SymbolpreferredSymbolAlias- optionalSymbolAlias- Returns:
- new
WatchlistItem
-
updateWatchlistItem
@Transactional public WatchlistItem updateWatchlistItem(WatchlistItem watchlistItem, SymbolAlias preferredSymbolAlias) Updates an existingWatchlistItem.- Parameters:
watchlistItem-WatchlistItempreferredSymbolAlias- optionalSymbolAlias- Returns:
- updated
WatchlistItem
-
deleteWatchlistItem
Deletes the givenWatchlistItem.- Parameters:
watchlistItem-WatchlistItem- Returns:
- true if deleted
-
deleteWatchlistItemsBySymbol
-
clearPreferredSymbolAlias
Clears preferred alias references that point to the givenSymbolAlias.- Parameters:
symbolAlias-SymbolAlias
-