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 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 interface org.springframework.beans.factory.InitializingBean
    • setRepository

      @Autowired @Lazy public void setRepository(SavedPaymentMethodRepository<D> repository)
    • 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 of SavedPaymentMethods for the given owner type, owner id and tenant id
      Specified by:
      findByOwningUserTypeAndOwningUserIdAndTenantId in interface CustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
      Parameters:
      owningUserType - The type of the saved payment's owning user
      owningUserId - The id of the entity that owns this saved payment method
      tenantId - The ID of the Tenant 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 of SavedPaymentMethods for the given account and its parent accounts
      Specified by:
      findPageForAccount in interface CustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
      Parameters:
      accountId - The id of the entity's account
      parentAccountIds - A list of entity's parent account ids
      filters - additional filters to apply in the query.
      page - the requested page of results from the database
      contextInfo - 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 a SavedPaymentMethod given its id, account and its parent accounts This method is for B2B use cases where the SavedPaymentMethod.getOwningUserType() is DefaultSavedPaymentMethodOwningUserTypes.BLC_ACCOUNT.
      Specified by:
      findByIdForAccount in interface CustomizedSavedPaymentMethodRepository<D extends JpaSavedPaymentMethod>
      Parameters:
      paymentId - The id of the saved payment method
      accountId - The id of the entity's account
      parentAccountIds - A list of entity's parent account ids
      contextInfo - the context info
      Returns:
      A payment for the given payment id, account id, and parent accounts
    • getManagedType

      protected Class<D> 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

      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)
    • 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

      protected SavedPaymentMethodRepository<D> 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()