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 forJpaPriceListRepository
that 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 void
afterPropertiesSet()
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 persistentPriceLists
that 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 persistentPriceLists
whosePriceList.getUserTargets()
intersect with theuserTargets
provided that match the passed in currencies.protected Class<?>
getUserTargetType(Class<D> priceListType)
void
setRepository(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:
afterPropertiesSet
in 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:CustomizedPriceListRepository
The common use-case will be to find all persistentPriceLists
whosePriceList.getUserTargets()
intersect with theuserTargets
provided that match the passed in currencies.- Specified by:
findAllByUserTargetsInAndCurrencyIn
in 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:CustomizedPriceListRepository
The common use-case will be to find all persistentPriceLists
that target a given currency or fallback currency.- Specified by:
findAllByCurrencyIn
in 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:
findAllByContextIdIn
in interfaceCustomizedPriceListRepository<D extends JpaPriceList>
-
-