Community
Participate
Working Groups
Build Identifier: I20110428-0848 The following mapping constraints must be enforced for XmlID type mapping: • At most one field or property in a class can be annotated with @XmlID. We have a validation for this, but the validation stops working when @XmlAnyElement applies, e.g. there are two fields or properties in a class are annotated with @XmlID one of which is annotated with @XmlAnyElemnet. • The only other program annotations allowed with @XmlID are @XmlAttribute and @XmlElement. We allow a class to be annotated with annotations other than @XmlAttribute and @XmlElement. Reproducible: Always
Note that once @XmlAnyElement is present on a java attribute, we ignore @XmlID. The validation should be a higher level "this annotation and that annotation don't work together", and probably should be a different bug. From the JAXB 2.2 spec (8.9.11.2) - At most one field or property in a class can be annotated with @XmlID. [ Done, see above] - The type of the field or property must be java.lang.String. - The only other program annotations allowed with @XmlID are: @XmlAttribute and @XmlElement. [ See above ] Also: - The schema type must be mapped to xs:ID.
Added for 3.1 M3.