This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
If I want to convert a class to XML, and that class contains a non primitive type, what do I do? In my case, I want to convert class Employee to XML, but it contains a non-primitive type (Department) that is another table. My simple example of this appears below.
The XML I want displayed is the following (I'm building a RESTful interface):
I'm using Spring, so it would be especially helpful if you could tell me how to do this using one of the marshallers they make available (JAXB, Castor, XMLBeans, JiBX, or XStream).