Class JpaCustomizedMarketingMessageRepository<D extends JpaMarketingMessage>
java.lang.Object
com.broadleafcommerce.promotion.offer.provider.jpa.repository.JpaCustomizedMarketingMessageRepository<D>
- All Implemented Interfaces:
CustomizedMarketingMessageRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedMarketingMessageRepository<D extends JpaMarketingMessage>
extends Object
implements CustomizedMarketingMessageRepository<D>, org.springframework.beans.factory.InitializingBean
- Author:
- Nathan Moore (nathanmoore).
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected final List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer>
-
Constructor Summary
ConstructorDescriptionJpaCustomizedMarketingMessageRepository
(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil trackableBehaviorUtil, List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers, cz.jirutka.rsql.parser.ast.RSQLVisitor<jakarta.persistence.criteria.Predicate, Class<?>> rsqlVisitor, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected <D extends JpaMarketingMessage>
voidfilterByOfferContextId
(Collection<String> offerContextIds, List<jakarta.persistence.criteria.Predicate> predicates, jakarta.persistence.criteria.Root<D> root, jakarta.persistence.criteria.CriteriaBuilder builder, Map<String, Object> narrowingParams, List<String> collected) findAllByOfferContextIdIn
(Collection<String> offerContextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) org.springframework.data.domain.Page<D>
findAllByOfferContextIdIn
(Collection<String> offerContextIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the persistentMarketingMessages
for the givenOffer IDs
.findAllNonExpired
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the persistentMarketingMessages
that are not expired meaning theMarketingMessage.activeEndDate
is not null and is not in the past.protected JpaMarketingMessageRepository<D>
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager
void
setRepository
(JpaMarketingMessageRepository<D> repository)
-
Field Details
-
jpaNarrowingHelper
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper jpaNarrowingHelper -
rsqlQueryTransformers
protected final List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers
-
-
Constructor Details
-
JpaCustomizedMarketingMessageRepository
public JpaCustomizedMarketingMessageRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil trackableBehaviorUtil, List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers, cz.jirutka.rsql.parser.ast.RSQLVisitor<jakarta.persistence.criteria.Predicate, Class<?>> rsqlVisitor, 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
-
findAllByOfferContextIdIn
public List<D> findAllByOfferContextIdIn(Collection<String> offerContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
findAllByOfferContextIdIn
in interfaceCustomizedMarketingMessageRepository<D extends JpaMarketingMessage>
-
filterByOfferContextId
protected <D extends JpaMarketingMessage> void filterByOfferContextId(Collection<String> offerContextIds, List<jakarta.persistence.criteria.Predicate> predicates, jakarta.persistence.criteria.Root<D> root, jakarta.persistence.criteria.CriteriaBuilder builder, Map<String, Object> narrowingParams, List<String> collected) -
findAllNonExpired
public List<D> findAllNonExpired(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedMarketingMessageRepository
Finds all of the persistentMarketingMessages
that are not expired meaning theMarketingMessage.activeEndDate
is not null and is not in the past. Note, that the messages referenced offer may still be expired and should be verified by calling services.- Specified by:
findAllNonExpired
in interfaceCustomizedMarketingMessageRepository<D extends JpaMarketingMessage>
- Parameters:
contextInfo
- the context around sandboxing and multitenant state- Returns:
- List of all non-expired marketing messages
-
findAllByOfferContextIdIn
public org.springframework.data.domain.Page<D> findAllByOfferContextIdIn(Collection<String> offerContextIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedMarketingMessageRepository
Finds all of the persistentMarketingMessages
for the givenOffer IDs
.- Specified by:
findAllByOfferContextIdIn
in interfaceCustomizedMarketingMessageRepository<D extends JpaMarketingMessage>
- Parameters:
offerContextIds
-Offer IDs
of the parent offers.filters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.pageInfo
- Pagination informationcontextInfo
- the context around sandboxing and multitenant state- Returns:
- Paged result set of all marketing messages for the given offer IDs.
-
getManagedType
-
setRepository
-
getRepository
-
getRepositoryEntityTypeManager
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager()
-