0

I have a requirement to generate POJO using JAXB from the following XSD (partial). The elements is a collection of domain type and I want this to be Set<domainType>. I get List<domainType> in generated pojo with the following XSD. How can I instruct JAXB to generate this type as Set instead?

<xs:element name="sampleSetElements">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="elements" type="xyz:domainType" minOccurs="1" maxOccurs="unbounded" />            
        </xs:sequence>
    </xs:complexType>
</xs:element>
Saifur
  • 16,081
  • 6
  • 49
  • 73

1 Answers1

0

Try property/@collectionType customization. See docs here.

lexicore
  • 42,748
  • 17
  • 132
  • 221