I am new to web service. I am using JAX-WS and I am encountering problems regarding the cyclic references.
I have read the way to avoid this cyclic references problem is to define XMLRootElement and XML Transient using this link.
I am thinking if it is possible to define 2 XMLRootElement in this scenario.
Department has a one to many relationship bidirectional to Employee
I define XMLRootElement in Department and XML Transisent in Employee.
However, if I want to get the Employee.Department, then I was thinking if I can do this
Defining XMLRootElement in Employee and XMLTransient in Department.
In another words, the reason why I would need to define 2 XMLRootElement is because I want to use the get method using different class (i.e if I want to get department, I would call getDept(), if I want to use get employee, I would use getEmployee().)