cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can hybris support multiple xml annotations for property attribute during bean generation?

0 Likes
716

I need to annotation the DTO attribute in xxx-beans.xml with some XmlElement annotation.But i also want to add @NotNull annotation to the attribute for validation later on.But the property attribute only support one annotation

  <annotations> </annotations>
  


The beans.xsd only support one annotations for attribute.Does any one know how to add multiple annotations during bean generation?

Accepted Solutions (0)

Answers (1)

Answers (1)

arvind-kumar_avinash
Active Contributor
0 Likes

There can be up to 3 annotations. Please check the following:

 <xs:complexType name="property">
     <xs:sequence>
         <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
         <xs:element name="hints" type="hints" minOccurs="0" maxOccurs="1"/>
         <xs:element name="annotations" type="annotations" minOccurs="0" maxOccurs="3"/>
     </xs:sequence>
     <xs:attribute name="name" type="xs:string" use="required" />
     <xs:attribute name="type" type="xs:string" use="required" />
     <xs:attribute name="equals" type="xs:boolean" use="optional" />
     <xs:attribute name="deprecated" type="xs:string" use="optional">
         <xs:annotation>
             <xs:documentation>Marks property as deprecated. Allows defining a message.</xs:documentation>
         </xs:annotation>
     </xs:attribute>
 </xs:complexType>
0 Likes

Hi,Kumar.It says it supports three annotations.But when i used three annotations,only the last applies.The hybris version is 6.7