Interface CustomizedProductAssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- Type Parameters:
D- the type ofTrackableentity which is the persistent counterpart to aProductAsset
- All Known Subinterfaces:
JpaProductAssetRepository<D>,ProductAssetRepository<D>
- All Known Implementing Classes:
JpaCustomizedProductAssetRepository
public interface CustomizedProductAssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
Advanced functionality related to
ProductAsset maintenance and filtering.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptionlongcountNonProductionRecordsByProductIdsInTenant(Iterable<String> productContextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of non-production records that match the givenproductContextIdsand the given tenant context.findAllByProductContextIdIn(Collection<String> productContextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the product assets which are associated with any of the givenproductContextIds.findAllByProductContextIdIn(Collection<String> productContextIds, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the product assets which are associated with any of the givenproductContextIds.findAllLowestSortValuesByProductContextIds(List<String> productContextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds theProductAssetwith the lowestSortable.getSorting()value for each of the products provided inproductContextIds, and returns its sort value.org.springframework.data.domain.Page<D>searchAllWithProductContextId(String productContextId, Boolean isSorted, String searchString, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds allProductAssetsfor the given product context ID, optionally filtering by additional search/filter arguments.
-
Method Details
-
searchAllWithProductContextId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> searchAllWithProductContextId(String productContextId, @Nullable Boolean isSorted, @Nullable String searchString, cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds allProductAssetsfor the given product context ID, optionally filtering by additional search/filter arguments.If
searchStringis provided, then this method will search for assets whoseEntityAsset.url,EntityAsset.title,EntityAsset.altText, orEntityAsset.tagscontain it.If no
searchStringis provided, then this method will simply return all assets for the given product.This method also supports RSQL filtration via
filters.- Parameters:
productContextId- the value which the product context ID should match againstisSorted- (optional) if not-null, will restrict results to only includeProductAssetswhereProductAsset.sortedhas the given valuesearchString- (optional) a string which should be found inEntityAsset.url,EntityAsset.title,EntityAsset.altText, orEntityAsset.tagsfilters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.page- the requested page of results from the databasecontextInfo- the context to query within- Returns:
- the assets in the database with the given product context ID, optionally filtered by the given search/filter arguments (if provided)
-
findAllByProductContextIdIn
@Policy(operationTypes=READ) Stream<D> findAllByProductContextIdIn(Collection<String> productContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the product assets which are associated with any of the givenproductContextIds.- Parameters:
productContextIds- a collection of product context IDs which the results must be associated withcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- all of the product assets which are associated with any of the given
productContextIds
-
findAllByProductContextIdIn
@Policy(operationTypes=READ) Stream<D> findAllByProductContextIdIn(Collection<String> productContextIds, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the product assets which are associated with any of the givenproductContextIds.- Parameters:
productContextIds- a collection of product context IDs which the results must be associated withfilters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.contextInfo- context information surrounding sandboxing and multitenant state- Returns:
- all of the product assets which are associated with any of the given
productContextIds
-
countNonProductionRecordsByProductIdsInTenant
@Policy(operationTypes=READ) long countNonProductionRecordsByProductIdsInTenant(@NonNull Iterable<String> productContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of non-production records that match the givenproductContextIdsand the given tenant context.- Parameters:
productContextIds- IDs of parent Products to match againstcontext- Request context information around sandbox and multitenant state- Returns:
- the count of non-production records that match the given
productContextIdsand the given tenant context
-
findAllLowestSortValuesByProductContextIds
@Policy(operationTypes=READ) Map<String,String> findAllLowestSortValuesByProductContextIds(List<String> productContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds theProductAssetwith the lowestSortable.getSorting()value for each of the products provided inproductContextIds, and returns its sort value.- Parameters:
productContextIds- IDs of parent Products to match againstcontextInfo- Request context information around sandbox and multitenant state- Returns:
- pairings of product IDs to the lowest sort value found for the specified ID
-