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 Summary
ConstructorsConstructorDescriptionDefaultJpaCustomizableFulfillmentPricingConfigRepository(com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager) -
Method Summary
Modifier and TypeMethodDescriptionfetchConfig(BiFunction<jakarta.persistence.criteria.CriteriaBuilder, jakarta.persistence.criteria.Root<D>, jakarta.persistence.criteria.Predicate[]> predicateFunction) Create and execute a select query for JpaFulfillmentPricingConfig.getApplicationConfigsOnly(com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Fetch a List ofJpaFulfillmentPricingConfigfor the current application.protected jakarta.persistence.criteria.Predicate[]getApplicationOnlyPredicate(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.protected jakarta.persistence.EntityManagerprotected jakarta.persistence.criteria.PredicategetNotArchivedPredicate(jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root<D> root) Get a predicate to select for entities that are not archived.protected FulfillmentPricingConfigRepository<D>protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManagergetTenantConfigsOnly(com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Fetch a List ofJpaFulfillmentPricingConfigfor the current tenant that are not owned by an application.protected jakarta.persistence.criteria.Predicate[]getTenantOnlyPredicate(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.voidsetRepository(FulfillmentPricingConfigRepository<D> repository)
-
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:CustomizableFulfillmentPricingConfigRepositoryFetch a List ofJpaFulfillmentPricingConfigfor the current application. This does not return results owned by the tenant.- Specified by:
getApplicationConfigsOnlyin interfaceCustomizableFulfillmentPricingConfigRepository<D extends JpaFulfillmentPricingConfig>- Parameters:
context- The context of the request.- Returns:
- A List of
JpaFulfillmentPricingConfigfor the current application.
-
getTenantConfigsOnly
public List<D> getTenantConfigsOnly(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizableFulfillmentPricingConfigRepositoryFetch a List ofJpaFulfillmentPricingConfigfor the current tenant that are not owned by an application.- Specified by:
getTenantConfigsOnlyin interfaceCustomizableFulfillmentPricingConfigRepository<D extends JpaFulfillmentPricingConfig>- Parameters:
context- The context of the request.- Returns:
- A List of
JpaFulfillmentPricingConfigfor 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- TheCriteriaBuilderfor 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- TheCriteriaBuilderfor 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- TheCriteriaBuilderfor 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
-
getRepositoryEntityTypeManager
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager() -
setRepository
-
getRepository
-
getEntityManager
protected jakarta.persistence.EntityManager getEntityManager()
-