Wednesday, July 14, 2010

JPA, JAXB ... not finished yet

I could indeed load one entity... but

Here is my result

   
     
Clearly the actor is not passed in the response and so my graph of object is not passed...


Here is the thing I overlooked... https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html

"There are a few things to consider when you do this. First, the object to be referenced must have an ID that is unique within the whole document. You'd also need to ensure that the referenced objects are contained somewhere else (like in the Root class in this case), or else Bar objects will never be marshalled. This technique can be used to remove the cyclic references, but it's only possible when your object model has an easy cut point."


So...

No comments: