I am writing a Resteasy server application and am having trouble getting my superclasses to marshal. I have code something like this:
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "person")
class Person {
protected String name;
@XmlElement(name = "name")
public String getName() { return name; }
public void setName(String name) { this.name = name; }
}
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "employee")
class Employee extends Person {
protected Integer id;
@XmlElement(name = "id")
public Integer getId() { return id; }
public void setId(Integer id) { this.id = id; }
}
When I marshal the Employee class to XML, I get something like this:
<employee>
<id>12345</id>
</employee>
with no output of the name field inherited from the Person class.
What am I doing wrong?
Thanks, Ralph