Class DefaultContextReferencedItemModelService
- java.lang.Object
-
- de.hybris.platform.inboundservices.persistence.impl.DefaultContextReferencedItemModelService
-
- All Implemented Interfaces:
ContextReferencedItemModelService
public class DefaultContextReferencedItemModelService extends java.lang.Object implements ContextReferencedItemModelService
A service for searching for & creating items from the nested representation of these items in the payload for persistence.
-
-
Constructor Summary
Constructors Constructor Description DefaultContextReferencedItemModelService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ItemModel>deriveItemsReferencedInAttributeValue(PersistenceContext context, TypeAttributeDescriptor attribute)Derives a collection ofItemModels referenced by the specified attribute in the item payload present in the provided persistence context.ItemModelderiveReferencedItemModel(TypeAttributeDescriptor attribute, PersistenceContext referencedItemContext)Using the context derives an existingItemModelthat is referenced in the payload of the item to be persisted.voidsetContextItemModelService(ContextItemModelService contextItemModelService)
-
-
-
Method Detail
-
deriveItemsReferencedInAttributeValue
public java.util.Collection<ItemModel> deriveItemsReferencedInAttributeValue(PersistenceContext context, TypeAttributeDescriptor attribute)
Description copied from interface:ContextReferencedItemModelServiceDerives a collection ofItemModels referenced by the specified attribute in the item payload present in the provided persistence context.- Specified by:
deriveItemsReferencedInAttributeValuein interfaceContextReferencedItemModelService- 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 ornull. Found items are already updated with the values from their payloads.
-
deriveReferencedItemModel
public ItemModel deriveReferencedItemModel(TypeAttributeDescriptor attribute, PersistenceContext referencedItemContext)
Description copied from interface:ContextReferencedItemModelServiceUsing the context derives an existingItemModelthat is referenced in the payload of the item to be persisted.- Specified by:
deriveReferencedItemModelin interfaceContextReferencedItemModelService- 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 anItemModel.- Returns:
- an item specified by
PersistenceContext.getIntegrationItem()ornull, if such item does not exist in the platform. If the item is found, then it's already updated with the values from thereferencedItemContext.
-
setContextItemModelService
public void setContextItemModelService(ContextItemModelService contextItemModelService)
-
-