Interface PortfolioRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Portfolio, Long>, org.springframework.data.jpa.repository.JpaRepository<Portfolio, Long>, org.springframework.data.repository.ListCrudRepository<Portfolio, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Portfolio, Long>, org.springframework.data.repository.PagingAndSortingRepository<Portfolio, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Portfolio>, org.springframework.data.repository.Repository<Portfolio, Long>
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes thePortfoliowith the given id.findOwnedByPortfolioNumber(long portfolioNumber, Long userId) Returns an active portfolio owned by the given user.findPortfolioByPortfolioNumber(long portfolioNumber) Returns aPortfoliofor the given portfolio number.findPortfolioByPortfolioNumberAndUserUsername(long portfolioNumber, String username) Returns aPortfoliofor the given portfolio number and owner username.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
-
findPortfolioByPortfolioNumber
-
findPortfolioByPortfolioNumberAndUserUsername
-
findOwnedByPortfolioNumber
@Query("SELECT p FROM Portfolio p\nWHERE p.portfolioNumber = :portfolioNumber\n AND p.user.id = :userId\n AND p.active = true\n") Optional<Portfolio> findOwnedByPortfolioNumber(@Param("portfolioNumber") long portfolioNumber, @Param("userId") Long userId) Returns an active portfolio owned by the given user. -
deletePortfolioById
-