You are on page 1of 10

Approach 1

Extending TWMProduct from Product and TWMItem from VariantProduct.
Type definition:
<typegroup name="TWM">
<itemtype code="TWMProduct" extends="Product"
autocreate="true" generate="true"
jaloclass="de.hybris.platform.yacceleratorcore.jalo.TWMProduct">
<description>Total Wines Product type that contains additional
attribute specific to TWM product model.
</description>
<attributes>
<attribute qualifier="fullName"
type="java.lang.String">
<description>shortName of the
product.</description>
<modifiers/>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>
<itemtype code="TWMItem" extends="VariantProduct"
autocreate="true" generate="true"
jaloclass="de.hybris.platform.yacceleratorcore.jalo.TWMItem">
<description>Total Wines Product type that contains additional
attribute specific to TWM product model.
</description>
<attributes>
<attribute qualifier="volume" type="java.lang.String">
<description>volume of the item.</description>
<modifiers/>
<persistence type="property"/>
</attribute>
</attributes>
</itemtype>
</typegroup>

TWMProduct creation in hmc:

jalo.TWMProduct"> <description>Total Wines Product type that contains additional attribute specific to TWM product model.hybris. </description> <attributes> .Above appoarch will not expose TWMProduct specific attributes to TWMItem because of the no direct inheritance Approach 2 Extending TWMProduct from VariantProduct and TWMItem from VariantProduct. Type definition: <typegroup name="TWM"> <itemtype code="TWMProduct" extends="VariantProduct" autocreate="true" generate="true" jaloclass="de.platform.yacceleratorcore.

hybris.</description> <description>shortName of the <modifiers/> <persistence type="property"/> </attribute> </attributes> </itemtype> <itemtype code="TWMItem" extends="VariantProduct" autocreate="true" generate="true" jaloclass="de.jalo.TWMItem"> <description>Total Wines Product type that contains additional attribute specific to TWM product model.String"> product.lang.<attribute qualifier="fullName" type="java.String"> <description>volume of the item.lang.yacceleratorcore. </description> <attributes> <attribute qualifier="volume" type="java.</description> <modifiers/> <persistence type="property"/> </attribute> </attributes> </itemtype> </typegroup> Error while creating TWMProduct: .platform.

hybris.String"> <description>shortName of the product.platform.yacceleratorcore. Making baseProduct at TWMProduct level optional.Approach 3 Extending TWMProduct from VariantProduct and TWMItem from VariantProduct.jalo. </description> <attributes> <attribute qualifier="volume" type="java.yacceleratorcore.TWMItem"> <description>Total Wines Product type that contains additional attribute specific to TWM product model. </description> <attributes> <attribute qualifier="baseProduct" type="Product" redeclare="true"> <persistence type="property"/> <modifiers read="true" write="true" search="true" optional="true" initial="false"/> </attribute> <attribute qualifier="fullName" type="java. Type definition: <typegroup name="TWM"> <itemtype code="TWMProduct" extends="VariantProduct" autocreate="true" generate="true" jaloclass="de.lang.platform.lang.</description> <modifiers/> <persistence type="property"/> </attribute> </attributes> </itemtype> <itemtype code="TWMItem" extends="VariantProduct" autocreate="true" generate="true" jaloclass="de.hybris.</description> <modifiers/> <persistence type="property"/> </attribute> </attributes> </itemtype> </typegroup> Error while creating TWMProduct in hmc: .jalo.String"> <description>volume of the item.TWMProduct"> <description>Total Wines Product type that contains additional attribute specific to TWM product model.

ItemModelConverter.exceptions.java:1841) Type Definition: .servicelayer.converter.servicelayer.exceptions.hybris.platform.servicelayer..impl.ModelSavingException: missing [baseProduct] for creating a new VariantProduct at de.platform.Exception in logs: ERROR [hybrisHTTP36] [GenericItemCreateAction] create(..hybris.platform.internal.): Exception occured during creation process! de.ModelSavingException: missing [baseProduct] for creating a new VariantProduct at de.createN ewItem(ItemModelConverter.hybris.

After Initialization .

ModelSavingException: missing [baseProduct] for creating a new VariantProduct at de.): Exception occured during creation process! de.exceptions.servicelayer..hybris.exceptions.internal.ItemModelConverter..platform.impl.hybris.servicelayer.converter.hybris.Exception in logs: ERROR [hybrisHTTP36] [GenericItemCreateAction] create(.java:1841) .ModelSavingException: missing [baseProduct] for creating a new VariantProduct at de.servicelayer.createN ewItem(ItemModelConverter.platform.platform.

Type Definition .

String"> <description>volume of the item.Approach 4 Extending TWMProduct from VariantProduct and TWMItem from VariantProduct.</description> <modifiers/> <persistence type="property"/> </attribute> </attributes> </itemtype> <itemtype code="TWMItem" extends="VariantProduct" autocreate="true" generate="true" jaloclass="de. </description> <attributes> <attribute qualifier="fullName" type="java.jalo.yacceleratorcore.TWMProduct"> <description>Total Wines Product type that contains additional attribute specific to TWM product model.TWMItem"> <description>Total Wines Product type that contains additional attribute specific to TWM product model.jalo.lang. </description> <attributes> <attribute qualifier="baseProduct" type="Product" generate="false" autocreate="false" redeclare="true"> <persistence type="property"/> <modifiers read="true" write="true" search="true" optional="true" initial="false"/> .</description> <modifiers/> <persistence type="property"/> </attribute> </attributes> </itemtype> <itemtype code="VariantProduct" autocreate="false" generate="false"> <description>Total Wines Product type that contains additional attribute specific to TWM product model.hybris. Making baseProduct at VariantProduct level optional.String"> <description>shortName of the product. </description> <attributes> <attribute qualifier="volume" type="java.platform.hybris. Type definition: <typegroup name="TWM"> <itemtype code="TWMProduct" extends="VariantProduct" autocreate="true" generate="true" jaloclass="de.yacceleratorcore.platform.lang.

</attribute> </attributes> </itemtype> </typegroup> No effect on the type system after system update: After Initialization .