Class DefaultJpaVendorNarrowingQueryCustomizer

java.lang.Object
com.broadleafcommerce.sandbox.provider.jpa.marketplace.vendor.DefaultJpaVendorNarrowingQueryCustomizer
All Implemented Interfaces:
JpaVendorNarrowingQueryCustomizer

public class DefaultJpaVendorNarrowingQueryCustomizer extends Object implements JpaVendorNarrowingQueryCustomizer
Default implementation of JpaVendorNarrowingQueryCustomizer.
  • Constructor Details

    • DefaultJpaVendorNarrowingQueryCustomizer

      public DefaultJpaVendorNarrowingQueryCustomizer(com.broadleafcommerce.data.tracking.core.policy.trackable.marketplace.vendor.VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils, JpaVendorNarrowingCriteriaManager vendorCriteriaManager)
  • Method Details

    • buildVendorNarrowingCriteriaForCurrentAuthentication

      @Nullable public <D> jakarta.persistence.criteria.Predicate buildVendorNarrowingCriteriaForCurrentAuthentication(@NonNull @NonNull Class<D> persistedDomainTypeToRead, @NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<?> criteriaQuery, @NonNull @NonNull jakarta.persistence.criteria.Root<D> root, @NonNull @NonNull Map<String,Object> queryParameters, @NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: JpaVendorNarrowingQueryCustomizer
      Depending on the current authentication's restrictions/permissions and the current operation's policy requirements, it may be necessary to restrict query results to only include data from certain vendors.

      This method is responsible for building a Predicate that can be added to the provided query for restricting results to only include those appropriate for the current authentication, current policy requirements, and the persisted-domain entity being read.

      Specified by:
      buildVendorNarrowingCriteriaForCurrentAuthentication in interface JpaVendorNarrowingQueryCustomizer
      Type Parameters:
      D - the persisted-domain type of the entity being queried
      Parameters:
      persistedDomainTypeToRead - the persisted-domain type of the entity being queried
      criteriaQuery - the query for which vendor-narrowing criteria should be built
      root - the entity root for the query
      queryParameters - parameters that will be set on the query
      criteriaBuilder - a standard criteria builder
      contextInfo - context information surrounding multitenant state. While typical narrowing will not apply, this parameter may be useful to certain implementations for determining additional information about the request.
      Returns:
      a Predicate that can appropriate filter query results to only include the records accessible by the current authentication. Alternatively, returns null if no vendor narrowing should be applied.
      See Also:
    • getVendorAwareTrackablePolicyUtils

      protected com.broadleafcommerce.data.tracking.core.policy.trackable.marketplace.vendor.VendorAwareTrackablePolicyUtils getVendorAwareTrackablePolicyUtils()
    • getVendorCriteriaManager

      protected JpaVendorNarrowingCriteriaManager getVendorCriteriaManager()