Class VariantProductModelConverter

java.lang.Object
de.hybris.platform.servicelayer.internal.converter.impl.ItemModelConverter
de.hybris.platform.servicelayer.internal.converter.impl.VariantProductModelConverter
All Implemented Interfaces:
TypeSystemAwareModelConverter, UpdateableModelConverter, ModelConverter, Cloneable

public class VariantProductModelConverter extends ItemModelConverter
VariantProduct - specific ModelConverter. It's required for VariantProducts to provide the correct type (via getType). Using the default ItemModelConverter the returned type is recognized as abstract by VariantType, which is used during the save - action.
  • Constructor Details

  • Method Details

    • getType

      public String getType(Object model)
      Returns the exact type of the given model. This method is overridden because it requires some specific handling for VariantProduct. The returned Type would be typically "VariantProduct" (itemType), which is recognized as abstract in the variantType, which will be used later before persisting the object. In such case - ModelServiceException is thrown. The proper solution for VariantProduct is to return variant type of the base product type.
      Specified by:
      getType in interface ModelConverter
      Overrides:
      getType in class ItemModelConverter
    • getTypeFromBaseProduct

      protected String getTypeFromBaseProduct(VariantProductModel model)