1

The setting is as follows. I use MOXy 2.4.0 as jaxb provider in JBoss 6.1.0.Final. RESTEasy is used as JAX-RS provider. When an entity is unmarshalled, that references the same entity (same id's) multiple times, different instances of that entity are initialized. To make sure that both references point to the same instance, I have to set the fields on my own. Is there any approach to make sure that two equal entities are unmarshalled to the same object instance?

Thanks, Sebastian

bdoughan
  • 147,609
  • 23
  • 300
  • 400
  • 1
    Are you trying to do something like this: http://stackoverflow.com/questions/5319024/using-jaxb-to-cross-reference-xmlids-from-two-xml-files – bdoughan Aug 24 '12 at 15:45
  • Yes, this is pretty much what I was searching for. I will just cache the already unmarshalled entities in the XmlAdapter and take the same instance from cache if there is another reference to the entity within the xml. Thanks! – Sebastian Bredehöft Aug 27 '12 at 06:29

0 Answers0