Class JpaCustomizedSegmentMemberRepository<D extends JpaSegmentMember>

java.lang.Object
com.broadleafcommerce.customer.provider.jpa.repository.JpaCustomizedSegmentMemberRepository<D>
All Implemented Interfaces:
CustomizedSegmentMemberRepository<D>, org.springframework.beans.factory.InitializingBean

public class JpaCustomizedSegmentMemberRepository<D extends JpaSegmentMember> extends Object implements CustomizedSegmentMemberRepository<D>, org.springframework.beans.factory.InitializingBean
  • Constructor Details

    • JpaCustomizedSegmentMemberRepository

      public JpaCustomizedSegmentMemberRepository(@NonNull CustomerRepository<com.broadleafcommerce.data.tracking.core.Trackable> customerRepository, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, 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 Details

    • setSegmentMemberRepository

      @Autowired @Lazy public void setSegmentMemberRepository(SegmentMemberRepository<D> segmentMemberRepository)
    • afterPropertiesSet

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

      @Policy(operationTypes={UPDATE,DELETE,CREATE}, param=0) @NonNull @Transactional public D save(@NonNull D entity, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      save in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
    • saveAll

      @NonNull @Transactional public Iterable<D> saveAll(Iterable<D> entities, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      saveAll in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
    • readAllBySegmentId

      public Stream<D> readAllBySegmentId(String segmentId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedSegmentMemberRepository
      Reads the segment members for the specified customer segment id matching the given filters.
      Specified by:
      readAllBySegmentId in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
      Parameters:
      segmentId - the CustomerSegment id
      filters - additional filters to apply in the query
      contextInfo - Request context information around sandbox and multitenant state
      Returns:
      the segment members for the specified customer segment id matching the given filters
    • findAllBySegmentIdAndCustomerIdIn

      public Stream<D> findAllBySegmentIdAndCustomerIdIn(@NonNull @NonNull String segmentId, @NonNull @NonNull Set<String> customerIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedSegmentMemberRepository
      Reads the segment members for the specified customer segment id and customer ids.
      Specified by:
      findAllBySegmentIdAndCustomerIdIn in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
      Parameters:
      segmentId - the CustomerSegment id
      customerIds - the set of Customer ids
      contextInfo - Request context information around sandbox and multitenant state
      Returns:
      the segment members for the specified customer segment id and customer ids
    • findAllBySegmentIdAndNotMatchingSegmentRule

      public org.springframework.data.domain.Page<D> findAllBySegmentIdAndNotMatchingSegmentRule(@NonNull @NonNull String segmentId, @NonNull @NonNull String segmentMatchRule, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedSegmentMemberRepository
      Reads the segment members for the specified customer segment id that no longer match the segment's rule.
      Specified by:
      findAllBySegmentIdAndNotMatchingSegmentRule in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
      Parameters:
      segmentId - The segment ID
      segmentMatchRule - The segment's rule used to identify members
      pageable - the requested page of results
      contextInfo - Context information surrounding sandboxing and multitenant state
      Returns:
      Reads the segment members for the specified customer segment id that no longer match the segment's rule.
    • removeAllByIds

      @Transactional public void removeAllByIds(@NonNull @NonNull Collection<String> segmentMemberIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedSegmentMemberRepository
      Removes SegmentMembers by id
      Specified by:
      removeAllByIds in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
      Parameters:
      segmentMemberIds - A collection of SegmentMember ids used to identify the records to be removed
      contextInfo - Context information surrounding sandboxing and multitenant state
    • findAllByCustomerEmailOrCustomerId

      public List<D> findAllByCustomerEmailOrCustomerId(@Nullable String customerEmail, @Nullable String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomizedSegmentMemberRepository
      Finds the segment members for the specified customer segment id and customer email addresses.
      Specified by:
      findAllByCustomerEmailOrCustomerId in interface CustomizedSegmentMemberRepository<D extends JpaSegmentMember>
      Parameters:
      customerEmail - Customer's email
      customerId - Customer's ID
      contextInfo - Request context information around sandbox and multitenant state
      Returns:
      the segment members for the specified customer segment id and customer email addresses
    • buildSegmentIdEqualsPredicate

      protected jakarta.persistence.criteria.Predicate buildSegmentIdEqualsPredicate(String segmentId, jakarta.persistence.criteria.Root<D> segmentMemberEntity, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String,Object> parameterValues)
    • buildCustomerInSegmentPredicate

      protected jakarta.persistence.criteria.Predicate buildCustomerInSegmentPredicate(String segmentMatchRule)
    • transformFilters

      protected cz.jirutka.rsql.parser.ast.Node transformFilters(cz.jirutka.rsql.parser.ast.Node filters)
    • getManagedType

      protected final Class<D> getManagedType()
    • getCustomerRepository

      @NonNull protected CustomerRepository<com.broadleafcommerce.data.tracking.core.Trackable> getCustomerRepository()
    • getRepositoryEntityTypeManager

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

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

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

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

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

      protected SegmentMemberRepository<D> getSegmentMemberRepository()
    • getNarrowingHelper

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

      protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> getFilterParser()
    • setFilterParser

      @Autowired public void setFilterParser(com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> filterParser)