Class JpaCustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
java.lang.Object
com.broadleafcommerce.paymenttransaction.provider.jpa.repository.JpaCustomizedSavedPaymentMethodRepository<D>
- All Implemented Interfaces:
CustomizedSavedPaymentMethodRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
extends Object
implements CustomizedSavedPaymentMethodRepository<D>, org.springframework.beans.factory.InitializingBean
-
Constructor Summary
ConstructorDescriptionJpaCustomizedSavedPaymentMethodRepository
(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager typeManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.persistence.criteria.Predicate
accountOrParentAccountOwnedPredicate
(@NonNull jakarta.persistence.criteria.CriteriaBuilder builder, @NonNull Map<String, Object> params, @NonNull String accountId, @NonNull jakarta.persistence.criteria.Root<D> savedPaymentMethod) void
protected void
applyRsqlCriteria
(@NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, @NonNull jakarta.persistence.criteria.CriteriaQuery<?> nativeQuery, @NonNull Map<String, Object> nativeQueryParams, @NonNull List<jakarta.persistence.criteria.Predicate> nativePredicates) jakarta.persistence.criteria.Predicate
buildOwningUserIdIsEqualToFilter
(@NonNull String owningUserId, @NonNull Map<String, Object> queryParams, @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, @NonNull jakarta.persistence.criteria.Root<? extends com.broadleafcommerce.data.tracking.core.Trackable> entity) protected jakarta.persistence.criteria.Predicate
contextIdIsEqual
(@NonNull jakarta.persistence.criteria.CriteriaBuilder builder, @NonNull jakarta.persistence.criteria.Root<D> savedPaymentMethod) findByIdForAccount
(@NonNull String paymentId, @NonNull String accountId, @NonNull List<String> parentAccountIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find aSavedPaymentMethod
given its id, account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT
.org.springframework.data.domain.Page<D>
findByOwningUserTypeAndOwningUserIdAndTenantId
(String owningUserType, String owningUserId, String tenantId, org.springframework.data.domain.Pageable pageable) Find a page ofSavedPaymentMethods
for the given owner type, owner id and tenant idorg.springframework.data.domain.Page<D>
findPageForAccount
(@NonNull String accountId, @NonNull List<String> parentAccountIds, @NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a page ofSavedPaymentMethods
for the given account and its parent accountsprotected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected SavedPaymentMethodRepository<D>
protected List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer>
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor
protected jakarta.persistence.criteria.Predicate
ownedTypeIsAccountAndAccountOwnedOrParentOwnedPredicate
(@NonNull jakarta.persistence.criteria.CriteriaBuilder builder, @NonNull Map<String, Object> params, @NonNull String owningUserId, @NonNull jakarta.persistence.criteria.Root<D> savedPaymentMethod) protected void
setByIdForAccountCriteria
(List<String> parentAccountIds, jakarta.persistence.criteria.CriteriaBuilder builder, Map<String, Object> params, String accountId, jakarta.persistence.criteria.Root<D> savedPaymentMethod, jakarta.persistence.criteria.CriteriaQuery<D> criteria) protected void
setPageForAccountCriteria
(List<String> parentAccountIds, jakarta.persistence.criteria.CriteriaBuilder builder, Map<String, Object> params, String accountId, jakarta.persistence.criteria.Root<D> savedPaymentMethod, List<jakarta.persistence.criteria.Predicate> allCriteria, jakarta.persistence.criteria.CriteriaQuery<D> criteria) void
setRepository
(SavedPaymentMethodRepository<D> repository) void
setRsqlQueryTransformers
(List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers) void
setRsqlVisitor
(com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor rsqlVisitor)
-
Constructor Details
-
JpaCustomizedSavedPaymentMethodRepository
public JpaCustomizedSavedPaymentMethodRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager typeManager)
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setRepository
-
findByOwningUserTypeAndOwningUserIdAndTenantId
public org.springframework.data.domain.Page<D> findByOwningUserTypeAndOwningUserIdAndTenantId(String owningUserType, String owningUserId, String tenantId, @Nullable org.springframework.data.domain.Pageable pageable) Description copied from interface:CustomizedSavedPaymentMethodRepository
Find a page ofSavedPaymentMethods
for the given owner type, owner id and tenant id- Specified by:
findByOwningUserTypeAndOwningUserIdAndTenantId
in interfaceCustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
- Parameters:
owningUserType
- The type of the saved payment's owning userowningUserId
- The id of the entity that owns this saved payment methodtenantId
- The ID of theTenant
this registration belongs to.pageable
- the requested page of results from the database- Returns:
- a page of payments for the given owner type and id
-
findPageForAccount
public org.springframework.data.domain.Page<D> findPageForAccount(@NonNull @NonNull String accountId, @NonNull @NonNull List<String> parentAccountIds, @NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedSavedPaymentMethodRepository
Find a page ofSavedPaymentMethods
for the given account and its parent accounts- Specified by:
findPageForAccount
in interfaceCustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
- Parameters:
accountId
- The id of the entity's accountparentAccountIds
- A list of entity's parent account idsfilters
- additional filters to apply in the query.page
- the requested page of results from the databasecontextInfo
- the context info- Returns:
- a page of save payment methods for the given account and parent accounts
-
findByIdForAccount
public Optional<D> findByIdForAccount(@NonNull @NonNull String paymentId, @NonNull @NonNull String accountId, @NonNull @NonNull List<String> parentAccountIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedSavedPaymentMethodRepository
Find aSavedPaymentMethod
given its id, account and its parent accounts This method is for B2B use cases where theSavedPaymentMethod.getOwningUserType()
isDefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT
.- Specified by:
findByIdForAccount
in interfaceCustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
- Parameters:
paymentId
- The id of the saved payment methodaccountId
- The id of the entity's accountparentAccountIds
- A list of entity's parent account idscontextInfo
- the context info- Returns:
- A payment for the given payment id, account id, and parent accounts
-
getManagedType
-
applyRsqlCriteria
protected void applyRsqlCriteria(@NonNull @NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, @NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<?> nativeQuery, @NonNull @NonNull Map<String, Object> nativeQueryParams, @NonNull @NonNull List<jakarta.persistence.criteria.Predicate> nativePredicates) -
setPageForAccountCriteria
protected void setPageForAccountCriteria(List<String> parentAccountIds, jakarta.persistence.criteria.CriteriaBuilder builder, Map<String, Object> params, String accountId, jakarta.persistence.criteria.Root<D> savedPaymentMethod, List<jakarta.persistence.criteria.Predicate> allCriteria, jakarta.persistence.criteria.CriteriaQuery<D> criteria) -
ownedTypeIsAccountAndAccountOwnedOrParentOwnedPredicate
protected jakarta.persistence.criteria.Predicate ownedTypeIsAccountAndAccountOwnedOrParentOwnedPredicate(@NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder builder, @NonNull @NonNull Map<String, Object> params, @NonNull @NonNull String owningUserId, @NonNull @NonNull jakarta.persistence.criteria.Root<D> savedPaymentMethod) -
buildOwningUserIdIsEqualToFilter
public jakarta.persistence.criteria.Predicate buildOwningUserIdIsEqualToFilter(@NonNull @NonNull String owningUserId, @NonNull @NonNull Map<String, Object> queryParams, @NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, @NonNull @NonNull jakarta.persistence.criteria.Root<? extends com.broadleafcommerce.data.tracking.core.Trackable> entity) -
setByIdForAccountCriteria
-
accountOrParentAccountOwnedPredicate
protected jakarta.persistence.criteria.Predicate accountOrParentAccountOwnedPredicate(@NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder builder, @NonNull @NonNull Map<String, Object> params, @NonNull @NonNull String accountId, @NonNull @NonNull jakarta.persistence.criteria.Root<D> savedPaymentMethod) -
contextIdIsEqual
protected jakarta.persistence.criteria.Predicate contextIdIsEqual(@NonNull @NonNull jakarta.persistence.criteria.CriteriaBuilder builder, @NonNull @NonNull jakarta.persistence.criteria.Root<D> savedPaymentMethod) -
getRepository
-
getRsqlQueryTransformers
protected List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> getRsqlQueryTransformers() -
setRsqlQueryTransformers
@Autowired(required=false) public void setRsqlQueryTransformers(List<com.broadleafcommerce.data.tracking.core.service.RsqlQueryTransformer> rsqlQueryTransformers) -
getRsqlVisitor
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor getRsqlVisitor() -
setRsqlVisitor
@Autowired public void setRsqlVisitor(com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaCriteriaBuilderRsqlVisitor rsqlVisitor) -
getNarrowingHelper
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper()
-