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 forJpaPriceListRepositorythat includes custom JPA query methods.- Author:
- Chad Harchar (charchar)
-
-
Field Summary
Fields Modifier and Type Field Description protected PriceListRepository<D>repository
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.springframework.data.domain.Page<D>findAllByContextIdIn(Iterable<String> contextIds, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)List<D>findAllByCurrencyIn(List<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)The common use-case will be to find all persistentPriceListsthat target a given currency or fallback currency.List<D>findAllByUserTargetsInAndCurrencyIn(Iterable<UserTarget> userTargets, Iterable<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)The common use-case will be to find all persistentPriceListswhosePriceList.getUserTargets()intersect with theuserTargetsprovided that match the passed in currencies.protected Class<?>getUserTargetType(Class<D> priceListType)voidsetRepository(PriceListRepository<D> repository)
-
-
-
Field Detail
-
repository
protected PriceListRepository<D extends JpaPriceList> repository
-
-
Constructor Detail
-
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 Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
setRepository
@Autowired @Lazy public void setRepository(PriceListRepository<D> repository)
-
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:CustomizedPriceListRepositoryThe common use-case will be to find all persistentPriceListswhosePriceList.getUserTargets()intersect with theuserTargetsprovided that match the passed in currencies.- Specified by:
findAllByUserTargetsInAndCurrencyInin interfaceCustomizedPriceListRepository<D extends JpaPriceList>
-
findAllByCurrencyIn
@NonNull public List<D> findAllByCurrencyIn(@NonNull List<javax.money.CurrencyUnit> currencies, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CustomizedPriceListRepositoryThe common use-case will be to find all persistentPriceListsthat target a given currency or fallback currency.- Specified by:
findAllByCurrencyInin interfaceCustomizedPriceListRepository<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:
findAllByContextIdInin interfaceCustomizedPriceListRepository<D extends JpaPriceList>
-
-