Interface JpaVendorNarrowingQueryCustomizer
- All Known Implementing Classes:
DefaultJpaVendorNarrowingQueryCustomizer
public interface JpaVendorNarrowingQueryCustomizer
Domains such as
ChangeSummary
, ChangeSummaryGroup
, and ChangeDeploy
are
not Trackable
and have lots of customized query behavior. Because of this, they cannot
participate in the "standard" vendor-narrowing behavior provided by
VendorNarrowingContextInfoCustomizer
and VendorVisibilityManager
.
This component is analogous to VendorNarrowingContextInfoCustomizer
and provides a
mechanism by which repository methods can add vendor narrowing behavior to queries.
-
Method Summary
Modifier and TypeMethodDescription<D> jakarta.persistence.criteria.Predicate
buildVendorNarrowingCriteriaForCurrentAuthentication
(Class<D> persistedDomainTypeToRead, jakarta.persistence.criteria.CriteriaQuery<?> criteriaQuery, jakarta.persistence.criteria.Root<D> root, Map<String, Object> queryParameters, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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.
-
Method Details
-
buildVendorNarrowingCriteriaForCurrentAuthentication
@Nullable <D> jakarta.persistence.criteria.Predicate buildVendorNarrowingCriteriaForCurrentAuthentication(Class<D> persistedDomainTypeToRead, jakarta.persistence.criteria.CriteriaQuery<?> criteriaQuery, jakarta.persistence.criteria.Root<D> root, Map<String, Object> queryParameters, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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.- Type Parameters:
D
- the persisted-domain type of the entity being queried- Parameters:
persistedDomainTypeToRead
- the persisted-domain type of the entity being queriedcriteriaQuery
- the query for which vendor-narrowing criteria should be builtroot
- the entity root for the queryqueryParameters
- parameters that will be set on the querycriteriaBuilder
- a standard criteria buildercontextInfo
- 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, returnsnull
if no vendor narrowing should be applied. - See Also:
-