Interface ProductAssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>

Type Parameters:
D - the type of Trackable entity which is the persistent counterpart to a ProductAsset
All Superinterfaces:
CustomizedProductAssetRepository<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:
JpaProductAssetRepository<D>

@NoRepositoryBean public interface ProductAssetRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable> extends com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>, CustomizedProductAssetRepository<D>
Repository for persistent counter-parts of ProductAsset.
Author:
Samarth Dhruva (samarthd)
  • Method Details

    • findByProductContextIdAndPrimaryTrue

      @Policy(operationTypes=READ) Optional<D> findByProductContextIdAndPrimaryTrue(String productContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the primary ProductAsset for the given ProductAsset.productId.
      Parameters:
      productContextId - the value to match against ProductAsset.productId
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      an optional containing the primary asset for a product, empty otherwise
    • findAllByProductContextIdInAndPrimaryTrue

      @Policy(operationTypes=READ) List<D> findAllByProductContextIdInAndPrimaryTrue(Iterable<String> productContextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the primary ProductAssets for the given product IDs.
      Parameters:
      productContextIds - IDs of the products for which to find primary assets
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      the primary ProductAssets for the given product IDs.
    • findAllByProductContextIdInAndContextIdNotInAndPrimaryTrue

      @Policy(operationTypes=READ) List<D> findAllByProductContextIdInAndContextIdNotInAndPrimaryTrue(Iterable<String> productContextIds, Iterable<String> assetIdsToExclude, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Finds the primary ProductAssets for the given product IDs excluding given asset IDs.
      Parameters:
      productContextIds - IDs of the products for which to find primary assets
      assetIdsToExclude - IDs of the assets to exclude
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      the primary ProductAssets for the given product IDs excluding given asset IDs.