Using JAXB&MOXy to convert JPA entities to XML and back again

Unrealityx

New Member
I am stuck with (I guess) a pretty trivial problem considering MOXy. Converting a class like this example (pastebin) to XML is no problem, converting it back goes without any errors too. Though, fields that are referencing another (or more) \[code\]Person\[/code\], will result in a null value.Is there any way to make this work without losing relationships? My guess is this is due to a reference by ID only, since JAXB has no way of knowing other existing objects. I have tried using \[code\]@XmlInverseReference\[/code\], though this resulted in an infinite loop on every try.
 
Back
Top