Posts

Showing posts with the label switch enum in hybris

Hybris enumtype static Vs dynamic

In Hybris, we can declare two type of enum, Static and Dynamic. Which basically differ by dynamic attribute (dynamic="false" and dynamic="true"). In simple words, I can say static enum( dynamic="false" ) is generated as the Java enum. In which list of values can only be changed during compilation time by changing the items.xml. In case of the dynamic enum( dynamic="true" ) we can change(add/remove) its values at runtime using hmc or Impex. Regardless of an Enum type(Static/Dynamic), all its values get stored in  enumerationvalues  table. You can fetch all values using below flexible query. select * from { enumerationvalue } Static Enum: <enumtype code="FixedValueType" autocreate="true" generate="true"> <value code="value1"/> <value code="value2"/> </enumtype> By default, the dynamic attribute is false(dynamic="false"). You