Interface CustomizedCampaignCodeRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
-
- Type Parameters:
D
- The type of the persistent version ofCampaignCode
for a specific data store implementation
- All Known Subinterfaces:
CampaignCodeRepository<D>
,JpaCampaignCodeRepository<D>
- All Known Implementing Classes:
JpaCustomizedCampaignCodeRepository
public interface CustomizedCampaignCodeRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
Provides advanced functionality forCampaignCodes
that require manually implemented queries rather than through Spring Data.- Author:
- Nathan Moore (nathandmoore)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default List<D>
findAllByCode(String code, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Finds allCampaignCodes
byCampaignCode.getCode()
.List<D>
findAllByCodes(Set<String> codes, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Finds allCampaignCodes
byCampaignCode.getCode()
.List<D>
findAllDuplicatesForCodesInCampaign(@NonNull String campaignId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Finds all duplicatesCampaignCodes
byCampaign.getId()
.Optional<D>
findByContextId(String contextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Finds a code by ID.List<D>
findExistingByCodesIncludeExpiredForCampaignId(Set<String> codes, String campaignId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Search all non-expired campaign codes or expired but belonging to the specified campaignId.Stream<D>
readAllByCampaignId(String campaignId, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads the campaign codes for the specified campaign id matching the given filters.
-
-
-
Method Detail
-
findByContextId
@Policy(operationTypes=READ) Optional<D> findByContextId(String contextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Finds a code by ID.- Parameters:
contextId
- The ID to matchcontextInfo
- Request context information around sandbox and multitenant state- Returns:
- The code by ID, or
Optional.empty()
if none.
-
findAllByCode
@Policy(operationTypes=READ) default List<D> findAllByCode(String code, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Finds allCampaignCodes
byCampaignCode.getCode()
.- Parameters:
code
- Code to matchcontext
- Request context information around sandbox and multitenant state- Returns:
- all
CampaignCodes
byCampaignCode.getCode()
.
-
findAllByCodes
@Policy(operationTypes=READ) List<D> findAllByCodes(Set<String> codes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Finds allCampaignCodes
byCampaignCode.getCode()
.- Parameters:
codes
- The set of codes to matchcontext
- Request context information around sandbox and multitenant state- Returns:
- all
CampaignCodes
byCampaignCode.getCode()
.
-
findAllDuplicatesForCodesInCampaign
@Policy(operationTypes=READ) List<D> findAllDuplicatesForCodesInCampaign(@NonNull @NonNull String campaignId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Finds all duplicatesCampaignCodes
byCampaign.getId()
. Typically, this will be used to check for duplicate campaign codes of campaign.- Parameters:
campaignId
- the campaign idcontext
- Request context information around sandbox and multitenant state- Returns:
- all duplicates
CampaignCodes
byCampaignCode.getId()
-
findExistingByCodesIncludeExpiredForCampaignId
@Policy(operationTypes=READ) List<D> findExistingByCodesIncludeExpiredForCampaignId(Set<String> codes, String campaignId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
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 ofCampaignCode
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.- Parameters:
codes
- The set of codes to matchcampaignId
- the campaign idcontext
- Request context information around sandbox and multitenant state- Returns:
- all
CampaignCodes
byCampaignCode.getCode()
that are also active or belonging to the specified campaignId - See Also:
CampaignCodeImportBatchHandler
-
readAllByCampaignId
@Policy(operationTypes=READ) Stream<D> readAllByCampaignId(String campaignId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Reads the campaign codes for the specified campaign id matching the given filters.- Parameters:
campaignId
- the campaign idfilters
- additional filters to apply in the querycontext
- Request context information around sandbox and multitenant state- Returns:
- the campaign codes for the specified campaign id matching the given filters
-
-