I'm using JAXB(xjc version 2.2.4-2) to generate Java classes from a XML Schema. The XML types that map to a Java primitive datatype don't add:
@XmlElement(required = true)
For example when using:
<element name="userId" type="long"/>
<element name="userName" type="string"/>
will result in:
//no annotation added here
protected long userId;
@XmlElement(required = true)
protected String userName;
Does anyone have an explanation why this happens?
Does any of this have to do with options that you can set with xjc?