Interface SegmentMemberRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- Type Parameters:
D
- Type ofTrackable
entity. Typically aSegmentMember
or subclass of SegmentMember.
- All Superinterfaces:
CustomizedSegmentMemberRepository<D>
,com.broadleafcommerce.common.extension.DomainTypeAware
,com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
,org.springframework.data.repository.Repository<D,
,String> com.broadleafcommerce.data.tracking.core.TrackableRepository<D>
,com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
- All Known Subinterfaces:
JpaSegmentMemberRepository<D>
@NoRepositoryBean
public interface SegmentMemberRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
extends com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, CustomizedSegmentMemberRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
Repository for managing customer/segment relationships.
-
Method Summary
Modifier and TypeMethodDescriptionfindByCustomerContextIdAndSegmentId
(String customerContextId, String segmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns a particular customer/segment relationshiporg.springframework.data.domain.Page<D>
findBySegmentId
(String segmentId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns a page of customer/segment relationships for the designated customer segment.readAllBySegmentIdAndCustomerEmailInIgnoreCase
(String segmentId, Set<String> emailAddresses, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the segment members for the specified customer segment id and customer email addresses.void
removeAllBySegmentId
(String customerSegmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Removes all customers from a segment.void
removeByCustomerContextIdAndSegmentId
(String customerId, String customerSegmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Removes the specified customer from a segment.Methods inherited from interface com.broadleafcommerce.customer.repository.CustomizedSegmentMemberRepository
findAllByCustomerEmailOrCustomerId, findAllBySegmentIdAndCustomerIdIn, findAllBySegmentIdAndNotMatchingSegmentRule, readAllBySegmentId, removeAllByIds, save, saveAll
Methods inherited from interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
findNotificationReadyMembers, setFailedNotificationAttempt, setNotificationAcknowledged
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRepository
archive, existsByContextId, findAll, findAll, findAll, findAll, findAll, findAll, findAllByContextId, findByContextId, findByContextIdAndCatalog, findByNativeId, findDeployable, findMaxSortMember, findMinSortMember, findOriginal, findPromotable, findPromoteOrientedItems, findRebasable, findRejectable, findRevertable, findTarget, getDomainType, getEntityInformation, getTrackableBehaviorUtil, getTypesToRegisterInMappingContext, pruneChangeDetails, pruneRestingNotificationStates, purgeObsoleteSandboxData, save, saveAll, setTrackableBehaviorUtil
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor
exists, findAll, findAll, findAll, findAll
-
Method Details
-
findBySegmentId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findBySegmentId(String segmentId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns a page of customer/segment relationships for the designated customer segment.- Parameters:
segmentId
- The segment IDfilters
- An RSQL filter used to narrow query results. May beEmptyNode
if no filters should be applied.pageable
- The requested page of results from the databasecontext
- Context information surrounding sandboxing and multitenant state- Returns:
- A page of customer/segment relationships
-
findByCustomerContextIdAndSegmentId
@Policy(operationTypes=READ) Optional<D> findByCustomerContextIdAndSegmentId(String customerContextId, String segmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns a particular customer/segment relationship- Parameters:
customerContextId
- The customer IDsegmentId
- The segment IDcontext
- Context information surrounding sandboxing and multitenant state- Returns:
- A customer/segment relationship
-
removeByCustomerContextIdAndSegmentId
@Policy(operationTypes={UPDATE,DELETE}) @Transactional void removeByCustomerContextIdAndSegmentId(String customerId, String customerSegmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Removes the specified customer from a segment.- Parameters:
customerId
- The customer IDcustomerSegmentId
- The segment IDcontext
- Context information surrounding sandboxing and multitenant state
-
removeAllBySegmentId
@Policy(operationTypes={UPDATE,DELETE}) void removeAllBySegmentId(String customerSegmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Removes all customers from a segment. This is primarily intended for use on segments with a derived list of customers (e.g. rule based) when rebuilding the customer set from scratch.- Parameters:
customerSegmentId
- The segment IDcontext
- Context information surrounding sandboxing and multitenant state
-
readAllBySegmentIdAndCustomerEmailInIgnoreCase
@Policy(operationTypes=READ) List<D> readAllBySegmentIdAndCustomerEmailInIgnoreCase(String segmentId, Set<String> emailAddresses, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the segment members for the specified customer segment id and customer email addresses.- Parameters:
segmentId
- theCustomerSegment
idemailAddresses
- the set ofCustomer
emailcontextInfo
- Request context information around sandbox and multitenant state- Returns:
- the segment members for the specified customer segment id and customer email addresses
-