Class JpaCustomizedCampaignCodeRepository<D extends JpaCampaignCode>

    • Constructor Detail

      • JpaCustomizedCampaignCodeRepository

        public JpaCustomizedCampaignCodeRepository​(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil,
                                                   com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager,
                                                   com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder,
                                                   List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers,
                                                   com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor rsqlVisitor)
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • findExistingByCodesIncludeExpiredForCampaignId

        public List<D> findExistingByCodesIncludeExpiredForCampaignId​(Set<String> codes,
                                                                      String campaignId,
                                                                      @Nullable
                                                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Description copied from interface: CustomizedCampaignCodeRepository
        Search all non-expired campaign codes or expired but belonging to the specified campaignId. This is useful to validate that the campaign codes can be added or updated. NOTE: This method is used during import of CampaignCode and because different DBs has a different limitation on how many entries can be in "in" statement please make sure that the property "broadleaf.dataimport.processor.batch-size" not exited this limitation.
        Specified by:
        findExistingByCodesIncludeExpiredForCampaignId in interface CustomizedCampaignCodeRepository<D extends JpaCampaignCode>
        Parameters:
        codes - The set of codes to match
        campaignId - the campaign id
        context - Request context information around sandbox and multitenant state
        Returns:
        all CampaignCodes by CampaignCode.getCode() that are also active or belonging to the specified campaignId
        See Also:
        CampaignCodeImportBatchHandler
      • readAllByCampaignId

        @Policy(operationTypes=READ)
        public Stream<D> readAllByCampaignId​(String campaignId,
                                             @Nullable
                                             cz.jirutka.rsql.parser.ast.Node filters,
                                             @Nullable
                                             com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CustomizedCampaignCodeRepository
        Reads the campaign codes for the specified campaign id matching the given filters.
        Specified by:
        readAllByCampaignId in interface CustomizedCampaignCodeRepository<D extends JpaCampaignCode>
        Parameters:
        campaignId - the campaign id
        filters - additional filters to apply in the query
        contextInfo - Request context information around sandbox and multitenant state
        Returns:
        the campaign codes for the specified campaign id matching the given filters
      • getManagedType

        protected Class<D> getManagedType()
        Helper method to get the underlying Class for the managed entity. The result is usually determined by RepositoryEntityTypeManager.getManagedType(Class, Class, EntityManager).
        Returns:
        the Class for the managed entity.
      • getBehaviorUtil

        protected com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil getBehaviorUtil()
      • getRepositoryEntityTypeManager

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

        protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder getCriteriaBuilder()
      • getNarrowingHelper

        protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper()
      • getEntityManager

        protected javax.persistence.EntityManager getEntityManager()
      • getRsqlQueryTransformers

        protected List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> getRsqlQueryTransformers()
      • getRsqlVisitor

        protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor getRsqlVisitor()