Interface CustomizedProductRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- All Known Subinterfaces:
JpaProductRepository<D>,ProductRepository<D>
- All Known Implementing Classes:
JpaCustomizedProductRepository
public interface CustomizedProductRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
Advanced functionality related to
Product.-
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteSimpleTagPropagationUpdate(com.broadleafcommerce.data.tracking.core.transition.propagation.hierarchy.fieldupdate.FieldUpdatePropagatorInput fieldUpdatePropagatorInput, com.broadleafcommerce.data.tracking.core.transition.propagation.hierarchy.fieldupdate.FieldUpdatePropagatorOutput fieldUpdatePropagatorOutput) Execute a propagation update forProduct.getTags().booleanexistsByBusinessType(String businessType, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Checks whether anyProductsexist that use the givenBusinessType typeKey.org.springframework.data.domain.Page<D>findAllByCategoryContextId(String categoryContextId, Boolean isSorted, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products in a given category.org.springframework.data.domain.Page<D>findAllByCategoryContextIdAndSortType(String categoryContextId, String sortType, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products in a given category and sorts them by the given sort type.findAllByContextIdAndInheritanceLine(Iterable<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products by context id for a given catalog inheritance linefindAllByContextIdIn(Iterable<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the products with matchingcontextIds.findAllByContextIdNotIn(Collection<String> exclusions, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the products matching the givenfilters, excluding any products whose IDs match a value inexclusions.findAllByUriIn(Iterable<String> uris, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the products with matchinguris.findAllDistinctContextId(int page, cz.jirutka.rsql.parser.ast.Node filters) Retrieves a list of unique product context IDs no larger thanpage.findAllDistinctContextIdPerContext(int page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieves a narrowed list of unique product context IDs narrowed on aContextInfoand no larger thanpage.findAllDistinctContextIdPerContextWithOptionalStipulations(cz.jirutka.rsql.parser.ast.Node filters, ProductStipulations stipulations, int pageSize, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieves a list of unique product context IDs narrowed on aContextInfoand no larger thanpage.org.springframework.data.domain.Page<D>findAllWithSortType(String sortType, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products and sorts them by the given sort type.longfindProductCountUsingReferencedOptionTemplate(String optionTemplateId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of products that haveProductOptionthat isisAddedByReferencewith the given option template ID.booleanWhetherProduct.getTags()is a valid simple propagatable field.
-
Method Details
-
findAllDistinctContextId
Retrieves a list of unique product context IDs no larger thanpage. It is expected that any appropriate offset is achieved through criteria designated infilters.- Parameters:
page- the requested amount of results from the database. -1 indicates no limit.filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.- Returns:
- unique product IDs
-
findAllDistinctContextIdPerContext
List<String> findAllDistinctContextIdPerContext(int page, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieves a narrowed list of unique product context IDs narrowed on aContextInfoand no larger thanpage. It is expected that any appropriate offset is achieved through criteria designated infilters.- Parameters:
page- the requested amount of results from the database. -1 indicates no limit.filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.context- The context used to help narrowing. For example, narrowing results to a particular catalog.- Returns:
- The narrowed list of unique product context IDs
-
findAllDistinctContextIdPerContextWithOptionalStipulations
List<String> findAllDistinctContextIdPerContextWithOptionalStipulations(@NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable ProductStipulations stipulations, int pageSize, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieves a list of unique product context IDs narrowed on aContextInfoand no larger thanpage. It is expected that any appropriate offset is achieved through criteria designated infilters.- Parameters:
filters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.stipulations- Additional filtering context to be applied during product fetch. Stipulations are applied as a set of OR conditions, and any match of any of the stipulations designates a match for this set of conditions. Optional.pageSize- the requested amount of results from the database. -1 indicates no limit.context- The context used to help narrowing. For example, narrowing results to a particular catalog.- Returns:
- The narrowed list of unique product context IDs
-
findAllByContextIdNotIn
@Policy(operationTypes=READ) Stream<D> findAllByContextIdNotIn(@NonNull Collection<String> exclusions, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the products matching the givenfilters, excluding any products whose IDs match a value inexclusions.- Parameters:
exclusions- a list of context IDs of products which should be excluded from the resultsfilters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.contextInfo- context information around sandboxing and multitenant state- Returns:
- all of the products matching the given
filters, excluding any products whose IDs match a value inexclusions
-
findAllByContextIdIn
@Policy(operationTypes=READ) List<D> findAllByContextIdIn(@NonNull Iterable<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the products with matchingcontextIds.- Parameters:
contextIds- The contextIds to matchcontextInfo- Request context information around sandbox and multitenant state- Returns:
- All of the products with matching
contextIds.
-
findAllByUriIn
@Policy(operationTypes=READ) List<D> findAllByUriIn(@NonNull Iterable<String> uris, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the products with matchinguris.- Parameters:
uris- The URIs to matchcontextInfo- Request context information around sandbox and multitenant state- Returns:
- All of the products with matching
uris.
-
findAllByCategoryContextId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByCategoryContextId(@NonNull String categoryContextId, @Nullable Boolean isSorted, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products in a given category.- Parameters:
categoryContextId- the context id of the category.isSorted- – Whether to return CategoryProducts where CategoryProduct.sorted is true, else false.filters- additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.page- the requested amount of results from the database. -1 indicates no limit.contextInfo- Request context information around sandbox and multitenant state- Returns:
- All the products in the given category
-
findAllByCategoryContextIdAndSortType
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByCategoryContextIdAndSortType(@NonNull String categoryContextId, @NonNull String sortType, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products in a given category and sorts them by the given sort type.- Parameters:
categoryContextId- the context id of the category.sortType- the sort type to use.filters- additional filters to apply in the query. Should be EmptyNode if no additionalpage- the requested amount of results from the database. -1 indicates no limit.contextInfo- Request context information around sandbox and multitenant state- Returns:
- All the products in the given category
-
findAllWithSortType
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllWithSortType(@NonNull String sortType, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products and sorts them by the given sort type.- Parameters:
sortType- the sort type to use.filters- additional filters to apply in the query. Should be EmptyNode if no additionalpage- the requested amount of results from the database. -1 indicates no limit.contextInfo- Request context information around sandbox and multitenant state- Returns:
- All products sorted by sort type
-
existsByBusinessType
@Policy(operationTypes=READ) boolean existsByBusinessType(@NonNull String businessType, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Checks whether anyProductsexist that use the givenBusinessType typeKey.- Parameters:
businessType- TheBusinessType.getTypeKey()to match with.context- Additional multitenant and sandbox information.- Returns:
- Whether any
Productsexist that use the giventypeKey. - Since:
- Catalog Service 2.2.2, Release Train 2.2.2
-
findProductCountUsingReferencedOptionTemplate
@Policy(operationTypes=READ) long findProductCountUsingReferencedOptionTemplate(@NonNull String optionTemplateId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of products that haveProductOptionthat isisAddedByReferencewith the given option template ID.This is useful for validation purposes to prevent deletion of an option template that is in use.
- Parameters:
optionTemplateId- the option template ID to check for referencescontext- the context information surrounding sandboxing and multitenant state- Returns:
- the count of products that reference the given option template ID
-
findAllByContextIdAndInheritanceLine
@Policy(operationTypes=READ) List<D> findAllByContextIdAndInheritanceLine(@NonNull Iterable<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all products by context id for a given catalog inheritance line- Parameters:
contextIds- the context ids to findcontextInfo- the information surrounding sandboxing and multitenant state, used to determine the catalog inheritance line- Returns:
- All products by context id for a given catalog inheritance line
-
isTagsASimplePropagatableField
@Policy(operationTypes=READ) boolean isTagsASimplePropagatableField()WhetherProduct.getTags()is a valid simple propagatable field.- Returns:
- true if
Product.getTags()is a valid simple propagatable field, false otherwise - Since:
- Catalog Services 2.3.0, Release Train 2.3.0
- See Also:
-
executeSimpleTagPropagationUpdate
@Policy(operationTypes=UPDATE) void executeSimpleTagPropagationUpdate(com.broadleafcommerce.data.tracking.core.transition.propagation.hierarchy.fieldupdate.FieldUpdatePropagatorInput fieldUpdatePropagatorInput, com.broadleafcommerce.data.tracking.core.transition.propagation.hierarchy.fieldupdate.FieldUpdatePropagatorOutput fieldUpdatePropagatorOutput) Execute a propagation update forProduct.getTags().- Parameters:
fieldUpdatePropagatorInput- input details about the propagationfieldUpdatePropagatorOutput- output details about the propagation. The implementation may populate information onto this object as needed.- Since:
- Catalog Services 2.3.0, Release Train 2.3.0
- See Also:
-