문제

I have a problem generating the schema for a class I have. What I have is:

@XmlRootElement

@XmlAccessorType(XmlAccessType.FIELD)

public Class User {

....

@XmlElement(required = true)

protected String name;

....

}

Now, when I generate the schema using schemagen the line refering to that attribute is:

<xs:element name="name" type="xs:string"/>

the minOcurrences attribute is missing, I don't know why it ignores the annotation, any help is greatly appreciated. Also on a separate and unrelated topic, why does schemagen complaint when my class is anotated with JPA annotations? Is there any workaround for this?

도움이 되었습니까?

해결책

Sorry, how stupid of me, the default value for minOccur is 1.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top