Core concept of deployment table in itemtype in hybris | use of build.development.mode=true in hybris

 Hello Friends,

Let’s discuss about deployment table definition in items means what is deployment and why should give, when it is mandatory , In which case you should not give deployment table.

So

1. What is deployment

 > Process of defining the table for the item type in items.xml is called deployment means specify the table name while defining the item type so that the values
 of the item type will be persisted in that table like below

  <itemtype code="EveryreplyCustomer" generate="true" autocreate="true" jaloclass="de.hybris.platform.acceleratorcms.jalo.components.EveryreplyCustomer">
      <description>It represents everyreply Customer.</description>
    <deployment table="EveryreplyCustomer" typecode="31003" />
  </itemtype>
 
 2. Now when it is mandatory to give deployment table it items definition

 > Before going to dicsuss i think below point you already know
   a. If the item type is not extending any item type then by default GenericItem will be considered as the parent of the item type.so the deployment ofGenericItem will be used by the item type.
   b. If we don’t specify the deployment for any of our item type then deployment specified in the closest type in the hierarchy will be considered.
  
  
Now before going to next lets discuss about   build.development.mode=true
so above is one of legacy mode which tell  "Build process checks the missing deployments"
               
 A.  So if build.development.mode=true in local.properties file then Build process checks the missing deployments
   a. If you define a itemtype B which extends a itemtype A and itemtype A has no deployment table then BUILD will FAIL
  
    <itemtype code="itemTypeA" generate="true" autocreate="true" jaloclass="de.hybris.platform.acceleratorcms.jalo.components.itemTypeA">
    </itemtype>
 
      <itemtype code="itemTypeB" generate="true" autocreate="true" extends="itemTypeA" jaloclass="de.hybris.platform.acceleratorcms.jalo.components.itemTypeA">
    </itemtype>
  
  
    But after given deployment table in itemtypeA then build will success
               
    Now again
               
                Test your knowledge with below
               
                <itemtype code="ItemTypeA" generate="true" autocreate="true"  jaloclass="de.hybris.platform.acceleratorcms.jalo.components.ItemTypeA">
                <description>It represents ItemTypeA.</description>
                <attributes>
                <attribute qualifier="myCustCustomerId1" type="java.lang.String" generate="true" autocreate="true">
                                <persistence type="property" />
                                <description>It is localized customerId of the everyreply user.</description>
                </attribute>
                </attributes>
                </itemtype>
                 will above throw build error?
                 
                 No, above will not throw build error
                 
    Again
                 
                 <itemtype code="ItemTypeA" generate="true" autocreate="true" extends="GenericItem" jaloclass="de.hybris.platform.acceleratorcms.jalo.components.ItemTypeA">
                <description>It represents ItemTypeA.</description>
                <attributes>
                <attribute qualifier="myCustCustomerId1" type="java.lang.String" generate="true" autocreate="true">
                <persistence type="property" />
                <description>It is localized customerId of the everyreply user.</description>
                </attribute>
                </attributes>
                </itemtype>

              will above throw build error?
               
                Yes , above will throw build error and you must be define deployment table. so after giving extends="GenericItem" rules will also apply here.
               
               
Again
               
                <itemtype code="ItemTypeA" generate="true" autocreate="true" extends="GenericItem" jaloclass="de.hybris.platform.acceleratorcms.jalo.components.ItemTypeA" abstract="true">
                <description>It represents ItemTypeA.</description>
                <attributes>
             <attribute qualifier="myCustCustomerId1" type="java.lang.String" generate="true" autocreate="true">
                <persistence type="property" />
                <description>It is localized customerId of the everyreply user.</description>
                </attribute>
                </attributes>
                </itemtype>
               
                will above throw build error ?
                 
                 No, In case abstract="true" there is no require to give deployment table while build.development.mode=true

               
B. if build.development.mode=false in local.properties file then Build process will not checks the missing deployments               


Hybris recommend

1. It is not recommend to build.development.mode=false because in this case there will storing many item types in GenericItem table will decrease the performance and possibility of data truncation due to columns limit in the table.
2. Deployment table should not be defined for any Item type if there is already a deployment defined for its super type otherwise it will decrease the performance as it has to perform multiple joins while retrieving.
                

No comments:

Post a Comment