1

I'm trying to create java to xsd for a java type that looks like this.

public class MainRequest<E extends AParentType<Person>> extends EObject {
private Transaction tran;
private E e;
private String email;
}

public class SubRequest extends MainRequest<AChildType> {
}

where AChildType extends AParentType.

when i try to create a schema for SubRequest. I expect it to substitute 'e' with AChildType, but it retains the AParentType.

Is there something wrong with this ? Is there anyway i can achieve this. Not sure if @XmlAdapter is a solution.

Appreciate help.

skaffman
  • 398,947
  • 96
  • 818
  • 769
sapien
  • 11
  • 1
  • what version of jaxb? Invoked precisely how? – bmargulies Dec 14 '09 at 01:50
  • I don't think `schemagen` works very well, it was always the red-haired step-brother of `XJC`. It's a bit back-to-front, anyway, it's much better to start with a schema and generate java from there, rather the other way around, which is why `schemagen` doesn't get much attention. – skaffman Dec 17 '09 at 08:27
  • You can put `@XmlTransient` on `MainRequest` and see what happen. Oh one more thing you can generate XSD with JAXBContext#geneateSchema – Jin Kwon Jun 26 '12 at 15:17

0 Answers0