Class JpaCustomizedOrderNoteRepository<D extends JpaOrderNote>
java.lang.Object
com.broadleafcommerce.order.provider.jpa.repository.JpaCustomizedOrderNoteRepository<D>
- All Implemented Interfaces:
CustomizedOrderNoteRepository<D>
public class JpaCustomizedOrderNoteRepository<D extends JpaOrderNote>
extends Object
implements CustomizedOrderNoteRepository<D>
- Author:
- Dima Myroniuk (dmyroniuk)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedOrderNoteRepository(List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor rsqlVisitor, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, JpaOrderTenantQueryHelper tenantQueryHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyRsqlCriteria(cz.jirutka.rsql.parser.ast.Node filters, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.CriteriaQuery<?> nativeQuery, Map<String, Object> nativeQueryParams, List<jakarta.persistence.criteria.Predicate> nativePredicates) jakarta.persistence.criteria.PredicatebuildOrderIdIsEqualToFilter(String orderId, Map<String, Object> queryParams, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, jakarta.persistence.criteria.Root<? extends com.broadleafcommerce.data.tracking.core.Trackable> entity) org.springframework.data.domain.Page<D>findAllByOrderIdAndMatchingTenant(String orderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve notes for the given order context ID.findByContextIdAndMatchingTenant(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves the order note matching the provided ID and the tenant fromContextInfoif present.protected jakarta.persistence.EntityManagerprotected OrderNoteRepository<D>protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManagerprotected List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer>protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitorprotected JpaOrderTenantQueryHelpervoidsetRepository(OrderNoteRepository<D> repository) voidvalidate()
-
Field Details
-
ORDER_ID
- See Also:
-
-
Constructor Details
-
JpaCustomizedOrderNoteRepository
public JpaCustomizedOrderNoteRepository(List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor rsqlVisitor, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, JpaOrderTenantQueryHelper tenantQueryHelper)
-
-
Method Details
-
validate
@PostConstruct public void validate() -
applyRsqlCriteria
-
findByContextIdAndMatchingTenant
public Optional<D> findByContextIdAndMatchingTenant(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedOrderNoteRepositoryRetrieves the order note matching the provided ID and the tenant fromContextInfoif present.This implementation finds all records within the tenant regardless of whether they're associated to an application.
- Specified by:
findByContextIdAndMatchingTenantin interfaceCustomizedOrderNoteRepository<D extends JpaOrderNote>- Parameters:
id- the id of the order note to findcontextInfo- context information surrounding multitenant state.- Returns:
- an
Optionalcontaining the requested order note if found within the tenant, orOptional.empty()otherwise
-
buildOrderIdIsEqualToFilter
-
findAllByOrderIdAndMatchingTenant
public org.springframework.data.domain.Page<D> findAllByOrderIdAndMatchingTenant(String orderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedOrderNoteRepositoryRetrieve notes for the given order context ID.This implementation finds all records within the tenant regardless of whether they're associated to an application.
- Specified by:
findAllByOrderIdAndMatchingTenantin interfaceCustomizedOrderNoteRepository<D extends JpaOrderNote>- Parameters:
orderId- the context ID of the order to search forfilters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.pageable- the requested page of results from the databasecontextInfo- context information around sandbox and multitenant state- Returns:
- a page of the notes associated with the given order context ID and tenant
-
getManagedType
-
getEntityManager
protected jakarta.persistence.EntityManager getEntityManager() -
getRsqlQueryTransformers
protected List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> getRsqlQueryTransformers() -
getRsqlVisitor
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor getRsqlVisitor() -
getRepositoryEntityTypeManager
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager() -
getTenantQueryHelper
-
getRepository
-
setRepository
-