Deployment in items.xml

Deployment:

Deployment is nothing but it is process of defining table for the item type in items.xml. In Deployment tag we specify table name and type code, table name type code is unique.

In Deployment tag we specify table name and type as below,

<deployment table="MyContactInfo" typecode="12000"/>

Typecode value should be greater than 10000 and lessthan 32765. Typecode is generally used during Primary Key generation and hence it should be unique.Type code values between 0 & 10000 are reserved by Hybris.

We define Deployment for the item type Mandatorily in following scenarios,

  1. Define the new item type without extending any existing item type.

Example:

<itemtype code="PickupPlant" autocreate="true" generate="true">
<deployment table="PickupPlant" typecode="31234" />
<attributes>
<attribute qualifier="name" type="java.lang.String">
<Persistence type="property" />
<modifiers read="true" write="true" />
</attribute>
<attribute qualifier="Id" type="java.lang.String">
<Persistence type="property" />
<modifiers read="true" write="true" />
</attribute>
</attributes>
</itemtype>

2. Defining new item type by extending it with existing item type.

Example:

<itemtype code="SubCart" extends="Cart" autocreate="true" generate="true">
<attributes>
<attribute qualifier="cartId" type="java.lang.String">
<Persistence type="property" />
<modifiers read="true" write="true" />
</attribute>
</attributes>
</itemtype>

We should not define Deployment table for any of the item type if there is already existing table.

3. Define existing item type again with new attributes.

Example:

<itemtype code="BaseStore" autocreate="false" generate="false">
<attributes>
<attribute qualifier="showCreditInformation" type="boolean">
<Persistence type="property" />
</attribute>
</attributes>
</itemtype>

Leave a comment