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
JpaPriceListRepository
that includes custom JPA query methods.- Author:
- Chad Harchar (charchar)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedPriceListRepository
(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
Modifier and TypeMethodDescriptionvoid
org.springframework.data.domain.Page<D>
findAllByContextIdIn
(Iterable<String> contextIds, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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.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 jakarta.persistence.EntityManager
getEm()
protected jakarta.persistence.EntityManager
Returns the entity manager used for this repository.protected PriceListRepository<D>
protected Class<?>
getUserTargetType
(Class<D> priceListType) void
setRepository
(PriceListRepository<D> repository)
-
Field Details
-
repository
-
-
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 interfaceorg.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 persistentPriceLists
whosePriceList.getUserTargets()
intersect with theuserTargets
provided that match the passed in currencies.- Specified by:
findAllByUserTargetsInAndCurrencyIn
in interfaceCustomizedPriceListRepository<D extends JpaPriceList>
-
getUserTargetType
-
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>
-
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
-
getRepository
-
setRepository
-
getEm
protected jakarta.persistence.EntityManager getEm()
-