tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Santiago Miguel Aranda Rojas" <santiago.aranda.telv...@gmail.com>
Subject Re: Fwd: @XmlTransient
Date Tue, 23 Jun 2009 18:11:53 GMT

I want to use Annotation @XmlTransient in order to filter an attribute of one class in the
client response. I mean my web service is going to return a "Employee" but I dont want return
its "department" attribute. Because it is neccesary in order to avoid cyclic references. Have
you check if I can use these annotations using tuscany.

https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html
class Department {
  String name;
  List<Employee> employees;
}

class Employee {
  @XmlTransient
  Department department;  // parent pointer
  String name;
  
  public void afterUnmarshal(Unmarshaller u, Object parent) {
    this.department = (Department)parent;
  }
}
Mime
View raw message