Interface PositionOrderRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<PositionOrder, Long>, org.springframework.data.jpa.repository.JpaRepository<PositionOrder, Long>, org.springframework.data.repository.ListCrudRepository<PositionOrder, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<PositionOrder, Long>, org.springframework.data.repository.PagingAndSortingRepository<PositionOrder, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<PositionOrder>, org.springframework.data.repository.Repository<PositionOrder, Long>
@Repository
public interface PositionOrderRepository
extends org.springframework.data.jpa.repository.JpaRepository<PositionOrder, Long>
Data-access layer for
PositionOrder entities.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Method Summary
Modifier and TypeMethodDescriptionlongcountByPositionId(Long positionId) Counts allPositionOrders for the given position id.findAllByPosition(Position position) Returns allPositionOrders for the givenPosition.findByIdAndPosition(Long id, Position position) Returns aPositionOrderby id for the givenPosition.findByPositionAndExternalOrderId(Position position, String externalOrderId) Returns aPositionOrderby imported external order id for the givenPosition.findFirstByExternalOrderId(String externalOrderId) Returns aPositionOrderby imported external order id.Returns a position order matching its request hierarchy and authenticated owner.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
-
findOwned
@Query("SELECT po FROM PositionOrder po\nWHERE po.id = :id\n AND po.position.positionNumber = :positionNumber\n AND po.position.account.accountNumber = :accountNumber\n AND po.position.account.user.id = :userId\n AND po.position.account.portfolio.active = true\n") Optional<PositionOrder> findOwned(@Param("id") long id, @Param("positionNumber") long positionNumber, @Param("accountNumber") String accountNumber, @Param("userId") Long userId) Returns a position order matching its request hierarchy and authenticated owner.- Parameters:
id- position order id decoded from its UIDpositionNumber- position numberaccountNumber- account numberuserId- owning user id- Returns:
OptionalofPositionOrder
-
findByIdAndPosition
Returns aPositionOrderby id for the givenPosition.- Parameters:
id- position order idposition-Position- Returns:
OptionalPositionOrder
-
findByPositionAndExternalOrderId
Returns aPositionOrderby imported external order id for the givenPosition.- Parameters:
position-PositionexternalOrderId- external order id- Returns:
OptionalPositionOrder
-
findFirstByExternalOrderId
Returns aPositionOrderby imported external order id.- Parameters:
externalOrderId- external order id- Returns:
OptionalPositionOrder
-
findAllByPosition
Returns allPositionOrders for the givenPosition.- Parameters:
position-Position- Returns:
ListofPositionOrders
-
countByPositionId
Counts allPositionOrders for the given position id.- Parameters:
positionId- position id- Returns:
- count
-