| Summary: | JAXB Externalized Metadata: Schema gen incorrect when composite is mapped to subclass of transient superclass | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | David McCann <david.mccann> | ||||
| Component: | Eclipselink | Assignee: | Matt MacIvor <matt.macivor> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | matt.macivor | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 171763 [details]
proposed fix and updated tests
Fix checked into trunk stream. Leaving open pending check in to 2.1 stream. Fix Checked in to 2.1 stream The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
If Employee has a composite mapping to CDNAddress, which extends Address which is marked transient, the following schema components are generated for CDNAddress: <xsd:complexType name="cdnAddress"> <xsd:complexContent> <xsd:extension base="address"> <xsd:sequence> <xsd:element name="street" type="xsd:string" minOccurs="0"/> <xsd:element name="city" type="xsd:string" minOccurs="0"/> <xsd:element name="country" type="xsd:string" minOccurs="0"/> <xsd:element name="prov" type="xsd:string" minOccurs="0"/> <xsd:element name="postal" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> Since Address is transient, it is not mapped to XML directly, but it's properties are to be mapped to a given subclass as if it were inlined. So we would expect to get: <xsd:complexType name="cdnAddress"> <xsd:sequence> <xsd:element name="street" type="xsd:string" minOccurs="0"/> <xsd:element name="city" type="xsd:string" minOccurs="0"/> <xsd:element name="country" type="xsd:string" minOccurs="0"/> <xsd:element name="prov" type="xsd:string" minOccurs="0"/> <xsd:element name="postal" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> ================================================= Model: public class Employee { public CDNAddress address; } public class Address { public String street; public String city; public String country; } public class CDNAddress extends Address { public String prov; public String postal; }