Class JpaCustomizedPriceListRepository<D extends JpaPriceList>

java.lang.Object
com.broadleafcommerce.pricing.provider.jpa.repository.JpaCustomizedPriceListRepository<D>
All Implemented Interfaces:
CustomizedPriceListRepository<D>, org.springframework.beans.factory.InitializingBean

@NoRepositoryBean public class JpaCustomizedPriceListRepository<D extends JpaPriceList> extends Object implements CustomizedPriceListRepository<D>, org.springframework.beans.factory.InitializingBean
Repository fragment for JpaPriceListRepositorythat includes custom JPA query methods.
Author:
Chad Harchar (charchar)
  • Field Details

  • Constructor Details

    • JpaCustomizedPriceListRepository

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

    • afterPropertiesSet

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

      @NonNull public List<D> findAllByUserTargetsInAndCurrencyIn(@NonNull Iterable<UserTarget> userTargets, @NonNull Iterable<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: CustomizedPriceListRepository
      The common use-case will be to find all persistent PriceLists whose PriceList.getUserTargets() intersect with the userTargets provided that match the passed in currencies.
      Specified by:
      findAllByUserTargetsInAndCurrencyIn in interface CustomizedPriceListRepository<D extends JpaPriceList>
    • getUserTargetType

      protected Class<?> getUserTargetType(Class<D> priceListType)
    • findAllByCurrencyIn

      @NonNull public List<D> findAllByCurrencyIn(@NonNull List<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedPriceListRepository
      The common use-case will be to find all persistent PriceLists that target a given currency or fallback currency.
      Specified by:
      findAllByCurrencyIn in interface CustomizedPriceListRepository<D extends JpaPriceList>
    • findAllByContextIdIn

      @NonNull public org.springframework.data.domain.Page<D> findAllByContextIdIn(@NonNull Iterable<String> contextIds, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      findAllByContextIdIn in interface CustomizedPriceListRepository<D extends JpaPriceList>
    • getEntityManager

      protected jakarta.persistence.EntityManager getEntityManager()
      Returns the entity manager used for this repository. It is strongly advised to use this method over getEm() or directly calling the entity manager as this will have greater backwards compatibility.
      Returns:
      the entity manager
    • getManagedType

      protected Class<D> getManagedType()
    • getRepository

      protected PriceListRepository<D> getRepository()
    • setRepository

      @Autowired @Lazy public void setRepository(PriceListRepository<D> repository)
    • getEm

      protected jakarta.persistence.EntityManager getEm()