Class JpaCustomizedOrderRepository<D extends JpaOrder>

    • Constructor Detail

      • JpaCustomizedOrderRepository

        public JpaCustomizedOrderRepository​(List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers,
                                            com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor rsqlVisitor,
                                            com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager,
                                            JpaOrderTenantQueryHelper tenantQueryHelper)
    • Method Detail

      • validate

        @PostConstruct
        public void validate()
      • findAllDistinctContextIds

        public List<String> findAllDistinctContextIds​(int page,
                                                      cz.jirutka.rsql.parser.ast.Node filters)
        Description copied from interface: CustomizedOrderRepository
        Retrieves a list of unique order context IDs no larger than page. It is expected that any appropriate offset is achieved through criteria designated in filters.
        Specified by:
        findAllDistinctContextIds in interface CustomizedOrderRepository<D extends JpaOrder>
        Parameters:
        page - the requested amount of results from the database. -1 indicates no limit.
        filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
        Returns:
        unique order IDs
      • setRepository

        @Autowired
        @Lazy
        public void setRepository​(OrderRepository<?> repository)
      • findByContextIdAndMatchingTenant

        public Optional<D> findByContextIdAndMatchingTenant​(String id,
                                                            @Nullable
                                                            com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CustomizedOrderRepository
        Retrieves the order matching the provided ID and the tenant from ContextInfo if present.

        Differs from the standard narrowing behavior of TrackableRepository.findByContextId(String, ContextInfo), which only returns tenant-level (non-application-associated) records when fetching from a tenant context. This implementation finds all records within the tenant regardless of whether they're associated to an application.

        Specified by:
        findByContextIdAndMatchingTenant in interface CustomizedOrderRepository<D extends JpaOrder>
        Parameters:
        id - the id of the order fulfillment to find
        contextInfo - context information surrounding multitenant state.
        Returns:
        an Optional containing the requested order if found within the tenant, or Optional.empty() otherwise
      • findAllByContextIdAndMatchingTenant

        public List<D> findAllByContextIdAndMatchingTenant​(Iterable<String> contextIds,
                                                           @Nullable
                                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CustomizedOrderRepository
        Retrieves the orders matching the provided IDs and the tenant from ContextInfo if present.

        Differs from the standard narrowing behavior of TrackableRepository.findByContextId(String, ContextInfo), which only returns tenant-level (non-application-associated) records when fetching from a tenant context. This implementation finds all records within the tenant regardless of whether they're associated to an application.

        Specified by:
        findAllByContextIdAndMatchingTenant in interface CustomizedOrderRepository<D extends JpaOrder>
        Parameters:
        contextIds - the ids of the orders to find
        contextInfo - context information surrounding multitenant state.
        Returns:
        The list of narrowed orders