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
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
RsqlQueryTransformer
implementation to be leveraged when applying a rule-based customer segment's rule to aJpaSegmentMember
query. -
Constructor Summary
ConstructorDescriptionJpaCustomizedSegmentMemberRepository
(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 Summary
Modifier and TypeMethodDescriptionvoid
protected jakarta.persistence.criteria.Predicate
buildCustomerInSegmentPredicate
(String segmentMatchRule) protected jakarta.persistence.criteria.Predicate
buildSegmentIdEqualsPredicate
(String segmentId, jakarta.persistence.criteria.Root<D> segmentMemberEntity, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String, Object> parameterValues) findAllByCustomerEmailOrCustomerId
(String customerEmail, String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the segment members for the specified customer segment id and customer email addresses.findAllBySegmentIdAndCustomerIdIn
(@NonNull String segmentId, @NonNull Set<String> customerIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the segment members for the specified customer segment id and customer ids.org.springframework.data.domain.Page<D>
findAllBySegmentIdAndNotMatchingSegmentRule
(@NonNull String segmentId, @NonNull String segmentMatchRule, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the segment members for the specified customer segment id that no longer match the segment's rule.protected com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder
protected CustomerRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node>
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager
protected List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer>
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor
protected SegmentMemberRepository<D>
readAllBySegmentId
(String segmentId, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the segment members for the specified customer segment id matching the given filters.void
removeAllByIds
(@NonNull Collection<String> segmentMemberIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) RemovesSegmentMembers
by idsaveAll
(Iterable<D> entities, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
setFilterParser
(com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> filterParser) void
setSegmentMemberRepository
(SegmentMemberRepository<D> segmentMemberRepository) protected cz.jirutka.rsql.parser.ast.Node
transformFilters
(cz.jirutka.rsql.parser.ast.Node filters)
-
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 interfaceorg.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 interfaceCustomizedSegmentMemberRepository<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 interfaceCustomizedSegmentMemberRepository<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 interfaceCustomizedSegmentMemberRepository<D extends JpaSegmentMember>
- Parameters:
segmentId
- theCustomerSegment
idfilters
- additional filters to apply in the querycontextInfo
- 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 interfaceCustomizedSegmentMemberRepository<D extends JpaSegmentMember>
- Parameters:
segmentId
- theCustomerSegment
idcustomerIds
- the set ofCustomer
idscontextInfo
- 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 interfaceCustomizedSegmentMemberRepository<D extends JpaSegmentMember>
- Parameters:
segmentId
- The segment IDsegmentMatchRule
- The segment's rule used to identify memberspageable
- the requested page of resultscontextInfo
- 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
RemovesSegmentMembers
by id- Specified by:
removeAllByIds
in interfaceCustomizedSegmentMemberRepository<D extends JpaSegmentMember>
- Parameters:
segmentMemberIds
- A collection ofSegmentMember
ids used to identify the records to be removedcontextInfo
- 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 interfaceCustomizedSegmentMemberRepository<D extends JpaSegmentMember>
- Parameters:
customerEmail
- Customer's emailcustomerId
- Customer's IDcontextInfo
- Request context information around sandbox and multitenant state- Returns:
- the segment members for the specified customer segment id and customer email addresses
-
buildSegmentIdEqualsPredicate
-
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
-
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
-
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)
-