Class DefaultContextReferencedItemModelService

java.lang.Object
de.hybris.platform.inboundservices.persistence.impl.DefaultContextReferencedItemModelService
All Implemented Interfaces:
ContextReferencedItemModelService

public class DefaultContextReferencedItemModelService extends Object implements ContextReferencedItemModelService
A service for searching for & creating items from the nested representation of these items in the payload for persistence.
  • Constructor Details

    • DefaultContextReferencedItemModelService

      public DefaultContextReferencedItemModelService()
  • Method Details

    • deriveItemsReferencedInAttributeValue

      public Collection<ItemModel> deriveItemsReferencedInAttributeValue(PersistenceContext context, TypeAttributeDescriptor attribute)
      Description copied from interface: ContextReferencedItemModelService
      Derives a collection of ItemModels referenced by the specified attribute in the item payload present in the provided persistence context.
      Specified by:
      deriveItemsReferencedInAttributeValue in interface ContextReferencedItemModelService
      Parameters:
      context - a persistence context containing information about the item being persisted.
      attribute - an attribute in the context item payload referencing a collection of items to be derived.
      Returns:
      a collection of items corresponding to the values of the specified attribute in PersistenceContext.getIntegrationItem() or an empty collection, if the payload either does not contain the attribute or the attribute value in the payload is empty or null. Found items are already updated with the values from their payloads.
    • deriveReferencedItemModel

      public ItemModel deriveReferencedItemModel(TypeAttributeDescriptor attribute, PersistenceContext referencedItemContext)
      Description copied from interface: ContextReferencedItemModelService
      Using the context derives an existing ItemModel that is referenced in the payload of the item to be persisted.
      Specified by:
      deriveReferencedItemModel in interface ContextReferencedItemModelService
      Parameters:
      attribute - an attribute that represents the relationship between the item model and the referenced item model that will be derived.
      referencedItemContext - a persistence context containing information about the item to be found or, in other words, payload of the item to be resolved and converted to an ItemModel.
      Returns:
      an item specified by PersistenceContext.getIntegrationItem() or null, if such item does not exist in the platform. If the item is found, then it's already updated with the values from the referencedItemContext.
    • setContextItemModelService

      public void setContextItemModelService(ContextItemModelService contextItemModelService)