- AtomicTypes are the most basic types available in the SAP Commerce Cloud.
- Basically we can understand Atomic types as Data type in Java
- They are the representation of Java number and String object types, such as java.lang.Integer or java.lang.String.
- most probably you will not have to define AtomicTypes anyway.
- When you define an AtomicType yourself, you need to assign a Java class object to it.
For details on a list of the AtomicTypes that are generated upon platform initialization, please refer to the atomictypes section of the core-items.xml file in the ${hybrishome} /bin/platform/ext/core/resources directory.
Syntax
<atomictypes>
<atomictype class="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.lang.Number" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.lang.Integer" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.lang.Boolean" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.lang.Byte" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.lang.Double" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.lang.Float" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.lang.Long" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.lang.Short" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.lang.String" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.lang.Character" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.util.Date" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.util.Map" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.lang.Class" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.util.ItemPropertyValue" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.util.ItemPropertyValueCollection" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="java.math.BigInteger" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="java.math.BigDecimal" extends="java.lang.Number" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.core.PK" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.util.TaxValue" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.util.DiscountValue" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.util.StandardDateRange" extends="java.lang.Object" autocreate="true" generate="false"/>
<atomictype class="de.hybris.platform.core.order.EntryGroup" extends="java.lang.Object" autocreate="true"/> </atomictypes>
Unlike the other types, an AtomicType definition does not have a code attribute to set the unique identifier.
Instead, the AtomicType’s class attribute is used as its reference.
Localization of types:
If you need to localize this referer into various languages, you may do so in the type localization file(s) ( locales_xx.properties , located in an extension’s resources/localization directory) – the following code snippet assigns a localization to the java.util.Date AtomicType:
Localization for type localized: java.util.Date
type.localized:java.util.date.name=Date
type.localized:java.util.date.description=This is a localized info text on a Date
Important Point:
The SAP Commerce Cloud stores AtomicType instances in the database as strings (VARCHAR) or numbers (NUMBER), if possible.
If you define AtomicTypes yourself, you need to make sure that those types are serialisable (that is, you need to find a storage format for them that your database system can manage).