Core concept of Atmoic type in Hybris. How to create Your own Atomic type in Hybris ?

Hello Friends 

If you are entry level in hybris, then you must have knowledge of some very basic of hybris type i.e. Atomic Type 

Some time interviewer ask question related atmic type in hybris like

what is atomic type in hybris?

How you can create your own atomic type in hybris ? if possible to create.


So Atomic type is most basic type in hybris which representation of java.lang.Number and java.lang.Object  like below

 <atomictype class="java.lang.Number" extends="java.lang.Object" autocreate="true" generate="false"/> 
 <atomictype class="java.lang.String" extends="java.lang.Object" autocreate="true" generate="false"/>

 Above already define atomic type in hybris

 If you want to create your own Atomic type in hybris then you have follow below steps like EveryReplyAtomicType then



 1. Create class EveryReplyAtomicType.java

 2. Then your class must have to implements Serializable interface

 Now define it define in your *.items.xml file as below

 <atomictype class="src.every.EveryReplyAtomicType.java" extends="java.lang.Object" autocreate="true" generate="false"/> 

 You can see in above declaration there in no code attribute to set the unique identifier. Instead, the AtomicType's class attribute is used as its reference.

 Your class

 EveryReplyAtomicType implements Serializable {

 }

No comments:

Post a Comment