Class ProductPersistedDomainCollectingMapperMember

java.lang.Object
com.broadleafcommerce.catalog.service.product.mapper.ProductPersistedDomainCollectingMapperMember
All Implemented Interfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware, com.broadleafcommerce.data.tracking.core.mapping.DomainMapper, com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember, org.springframework.core.Ordered

public class ProductPersistedDomainCollectingMapperMember extends Object implements com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember

In DefaultProductService, CRUD requests almost always flow through CrudEntityHelper, which performs a variety of operations before returning the ultimate result. The method contract just accepts and returns the business domain Product, which is sufficient in most cases. However, in some cases, the caller may find it valuable to have access to the fully updated persisted-domain Trackable representation to provide it as input to some other downstream process that can't use the business domain representation.

This mapper member is intended to run at the end of the mapping pipeline (last priority) during DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo) and collects the persisted domain instances into a ThreadLocal that the caller can access via CollectedProductPersistedDomainContext.

Since:
Catalog Service 2.3.0, Release Train 2.3.0
See Also:
  • Field Summary

    Fields inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware

    ALL_MATCH

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <P> P
    fromRepositoryDomain(Object repositoryDomain, P businessDomain, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
     
    int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapper

    deleteMap, getBusinessDomainType, modifyMap

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember

    fromBusinessDomain
  • Constructor Details

    • ProductPersistedDomainCollectingMapperMember

      public ProductPersistedDomainCollectingMapperMember()
  • Method Details

    • getDataRoutePartition

      public String getDataRoutePartition()
      Specified by:
      getDataRoutePartition in interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
    • fromRepositoryDomain

      @Nullable public <P> P fromRepositoryDomain(Object repositoryDomain, P businessDomain, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      fromRepositoryDomain in interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface com.broadleafcommerce.data.tracking.core.mapping.DomainMapperMember
      Specified by:
      getOrder in interface org.springframework.core.Ordered