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 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 interface org.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 interface CustomizedMarketingMessageRepository<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 persistent MarketingMessages that are not expired meaning the MarketingMessage.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 interface CustomizedMarketingMessageRepository<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 persistent MarketingMessages for the given Offer IDs.
      Specified by:
      findAllByOfferContextIdIn in interface CustomizedMarketingMessageRepository<D extends JpaMarketingMessage>
      Parameters:
      offerContextIds - Offer IDs of the parent offers.
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      pageInfo - Pagination information
      contextInfo - the context around sandboxing and multitenant state
      Returns:
      Paged result set of all marketing messages for the given offer IDs.
    • getManagedType

      protected Class<D> getManagedType()
    • setRepository

      @Autowired @Lazy public void setRepository(JpaMarketingMessageRepository<D> repository)
    • getRepository

      protected JpaMarketingMessageRepository<D> getRepository()
    • getRepositoryEntityTypeManager

      protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager()