Class DefaultJpaCustomizableFulfillmentPricingConfigRepository<D extends JpaFulfillmentPricingConfig>

java.lang.Object
com.broadleafcommerce.fulfillment.provider.jpa.repository.DefaultJpaCustomizableFulfillmentPricingConfigRepository<D>
All Implemented Interfaces:
CustomizableFulfillmentPricingConfigRepository<D>

public class DefaultJpaCustomizableFulfillmentPricingConfigRepository<D extends JpaFulfillmentPricingConfig> extends Object implements CustomizableFulfillmentPricingConfigRepository<D>
  • Constructor Details

    • DefaultJpaCustomizableFulfillmentPricingConfigRepository

      public DefaultJpaCustomizableFulfillmentPricingConfigRepository(com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager)
  • Method Details

    • getApplicationConfigsOnly

      public List<D> getApplicationConfigsOnly(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: CustomizableFulfillmentPricingConfigRepository
      Fetch a List of JpaFulfillmentPricingConfig for the current application. This does not return results owned by the tenant.
      Specified by:
      getApplicationConfigsOnly in interface CustomizableFulfillmentPricingConfigRepository<D extends JpaFulfillmentPricingConfig>
      Parameters:
      context - The context of the request.
      Returns:
      A List of JpaFulfillmentPricingConfig for the current application.
    • getTenantConfigsOnly

      public List<D> getTenantConfigsOnly(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: CustomizableFulfillmentPricingConfigRepository
      Fetch a List of JpaFulfillmentPricingConfig for the current tenant that are not owned by an application.
      Specified by:
      getTenantConfigsOnly in interface CustomizableFulfillmentPricingConfigRepository<D extends JpaFulfillmentPricingConfig>
      Parameters:
      context - The context of the request.
      Returns:
      A List of JpaFulfillmentPricingConfig for the current tenant.
    • getApplicationOnlyPredicate

      protected jakarta.persistence.criteria.Predicate[] getApplicationOnlyPredicate(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<D> root)
      Get a predicate to filter for configs whose application matches the current context.
      Parameters:
      context - The context of the request.
      builder - The CriteriaBuilder for the select query.
      root - The root entity of the query.
      Returns:
      A predicate to filter by the current application.
    • getTenantOnlyPredicate

      protected jakarta.persistence.criteria.Predicate[] getTenantOnlyPredicate(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<D> root)
      Get a predicate to filter for configs whose tenant matches the current context and application is null.
      Parameters:
      context - The context of the request.
      builder - The CriteriaBuilder for the select query.
      root - The root entity of the query.
      Returns:
      A predicate to filter by current tenant and null application.
    • getNotArchivedPredicate

      protected jakarta.persistence.criteria.Predicate getNotArchivedPredicate(jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<D> root)
      Get a predicate to select for entities that are not archived.
      Parameters:
      builder - The CriteriaBuilder for the select query.
      root - The root entity of the query.
      Returns:
      A predicate to filter by archived equals false.
    • fetchConfig

      protected List<D> fetchConfig(BiFunction<jakarta.persistence.criteria.CriteriaBuilder,jakarta.persistence.criteria.Root<D>,jakarta.persistence.criteria.Predicate[]> predicateFunction)
      Create and execute a select query for JpaFulfillmentPricingConfig. The predicate is provided by the given BiFunction.
      Parameters:
      predicateFunction - A function to return an array of Predicates for this select query.
      Returns:
      A list of results.
    • getManagedType

      protected Class<D> getManagedType()
    • getRepositoryEntityTypeManager

      protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager()
    • setRepository

      @Autowired @Lazy public void setRepository(FulfillmentPricingConfigRepository<D> repository)
    • getRepository

      protected FulfillmentPricingConfigRepository<D> getRepository()
    • getEntityManager

      protected jakarta.persistence.EntityManager getEntityManager()