Interface OrderRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
-
- Type Parameters:
D
- The trackable domain type the repository manages
- All Superinterfaces:
CustomizedOrderRepository<D>
,com.broadleafcommerce.common.extension.DomainTypeAware
,com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
,org.springframework.data.repository.Repository<D,String>
,com.broadleafcommerce.data.tracking.core.TrackableRepository<D>
,com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
- All Known Subinterfaces:
JpaOrderRepository<D>
@NoRepositoryBean public interface OrderRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable> extends com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>, CustomizedOrderRepository<D>
Repository
for persistent counterparts ofOrder
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.springframework.data.domain.Page<D>
findByAccountHierarchyContaining(String accountId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all orders where the account hierarchy contains the given account id.Optional<D>
findByCartId(String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find an order by its cart ID.org.springframework.data.domain.Page<D>
findByCustomerIdAndAccountId(String customerId, String accountId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all orders for the given customer id and account id.Optional<D>
findByOrderNumber(String orderNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find an order by its order number.org.springframework.data.domain.Page<D>
findByRootAccountId(String rootAccountId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all orders for the given root account id.-
Methods inherited from interface com.broadleafcommerce.order.repository.CustomizedOrderRepository
findAllByContextIdAndMatchingTenant, findAllDistinctContextIds, findByContextIdAndMatchingTenant
-
Methods inherited from interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
findNotificationReadyMembers, setFailedNotificationAttempt, setNotificationAcknowledged
-
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRepository
archive, existsByContextId, findAll, findAll, findAll, findAll, findAll, findAll, findAllByContextId, findByContextId, findByContextIdAndCatalog, findByNativeId, findDeployable, findMaxSortMember, findMinSortMember, findOriginal, findPromotable, findPromoteOrientedItems, findRebasable, findRejectable, findRevertable, findTarget, getDomainType, getEntityInformation, getTrackableBehaviorUtil, getTypesToRegisterInMappingContext, pruneChangeDetails, pruneRestingNotificationStates, purgeObsoleteSandboxData, save, saveAll, setTrackableBehaviorUtil
-
-
-
-
Method Detail
-
findByCartId
@Policy(operationTypes=READ) Optional<D> findByCartId(String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find an order by its cart ID.- Parameters:
cartId
- The order's cart IDcontextInfo
- The current context- Returns:
- The order with the cart ID if found
-
findByOrderNumber
@Policy(operationTypes=READ) Optional<D> findByOrderNumber(String orderNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find an order by its order number.- Parameters:
orderNumber
- The order's order numbercontextInfo
- The current context- Returns:
- The order with the order number if found
-
findByCustomerIdAndAccountId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findByCustomerIdAndAccountId(String customerId, String accountId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all orders for the given customer id and account id.- Parameters:
customerId
- the id of the customer who owns the ordersaccountId
- the id of the account that the orders belongs topage
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- all orders for the given customer id and account id
-
findByRootAccountId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findByRootAccountId(String rootAccountId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all orders for the given root account id.This is useful to query all the orders that belongs to the same root account.
For example, if we have this account setup, rootAcct -> subAcct (child of rootAcct) -> subSubAcct (child of subAcct), this query is useful to query all the orders that belong to the root account and its sub-accounts.
- Parameters:
rootAccountId
- the root account id of the orderspage
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- all orders for the given root account id
-
findByAccountHierarchyContaining
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findByAccountHierarchyContaining(String accountId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Find all orders where the account hierarchy contains the given account id.This is useful to query all the orders that belongs to the same non-root account and its sub-accounts.
For example, if we have this account setup, rootAcct -> subAcct (child of rootAcct) -> subSubAcct (child of subAcct), this query is useful to query all the orders that belong to the subAcct and its sub-accounts (subSubAcct in this case).
- Parameters:
accountId
- the account id to filter the account hierarchy bypage
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- all orders where the account hierarchy contains the given account id
-
-