Class JpaCustomizedVariantRepository<D extends JpaVariant>

java.lang.Object
com.broadleafcommerce.catalog.provider.jpa.repository.product.JpaCustomizedVariantRepository<D>
All Implemented Interfaces:
CustomizedVariantRepository<D>, org.springframework.beans.factory.InitializingBean

public class JpaCustomizedVariantRepository<D extends JpaVariant> extends Object implements CustomizedVariantRepository<D>, org.springframework.beans.factory.InitializingBean
Author:
Samarth Dhruva (samarthd)
  • Constructor Details

    • JpaCustomizedVariantRepository

      public JpaCustomizedVariantRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder filterRulesCriteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager)
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • setRepository

      @Autowired @Lazy public void setRepository(VariantRepository<D> repository)
    • findAllByContextIdIn

      public Stream<D> findAllByContextIdIn(Collection<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedVariantRepository
      Retrieves all variants whose context IDs match any of the given IDs.
      Specified by:
      findAllByContextIdIn in interface CustomizedVariantRepository<D extends JpaVariant>
      Parameters:
      contextIds - the context IDs to query for
      contextInfo - context information around sandbox and multitenant state
      Returns:
      all variants whose context IDs match any of the given IDs
    • findAllByProductContextIdIn

      public Stream<D> findAllByProductContextIdIn(Collection<String> productContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedVariantRepository
      Reads all of the variants which are associated with any of the given productContextIds.
      Specified by:
      findAllByProductContextIdIn in interface CustomizedVariantRepository<D extends JpaVariant>
      Parameters:
      productContextIds - a collection of product context IDs which the results must be associated with
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      all of the variants which are associated with any of the given productContextIds
    • findAllByVariantOrProductContextId

      public List<D> findAllByVariantOrProductContextId(@NonNull @NonNull Iterable<String> variantContextIds, @NonNull @NonNull Iterable<String> productContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: CustomizedVariantRepository
      Returns a stream of all the Variants that match either variantContextIds or productContextIds.
      Specified by:
      findAllByVariantOrProductContextId in interface CustomizedVariantRepository<D extends JpaVariant>
      Parameters:
      variantContextIds - Variant IDs to match against
      productContextIds - IDs of parent Products to match against
      context - Request context information around sandbox and multitenant state
      Returns:
      A stream of all the Variants that match either variantContextIds or productContextIds.
    • buildContextIdInFilter

      protected javax.persistence.criteria.Predicate buildContextIdInFilter(Collection<String> contextIds, javax.persistence.criteria.Root<D> variantEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String,Object> parameterValues)
    • buildProductContextIdInFilter

      protected javax.persistence.criteria.Predicate buildProductContextIdInFilter(Collection<String> productContextIds, javax.persistence.criteria.Root<D> variantEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String,Object> parameterValues)
    • getNarrowingHelper

      protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper()
    • getEntityManager

      protected javax.persistence.EntityManager getEntityManager()