Interface CustomizedProductAssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- Type Parameters:
D
- the type ofTrackable
entity 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 TypeMethodDescriptionlong
countNonProductionRecordsByProductIdsInTenant
(Iterable<String> productContextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns the count of non-production records that match the givenproductContextIds
and 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
.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 allProductAssets
for 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 allProductAssets
for the given product context ID, optionally filtering by additional search/filter arguments.If
searchString
is provided, then this method will search for assets whoseEntityAsset.url
,EntityAsset.title
,EntityAsset.altText
, orEntityAsset.tags
contain it.If no
searchString
is 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 includeProductAssets
whereProductAsset.sorted
has the given valuesearchString
- (optional) a string which should be found inEntityAsset.url
,EntityAsset.title
,EntityAsset.altText
, orEntityAsset.tags
filters
- additional filters to apply in the query. Should beEmptyNode
if 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 beEmptyNode
if 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 givenproductContextIds
and 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
productContextIds
and the given tenant context
-