I am developing a Java EE application to be deployed on a WebSphere application server. In this application, I have a Web Service, through which I would like to transfer JPA entity objects as results of method invocations. The problem comes from the loops generated by entity relationships.
I have used Eclipselink Moxy in order to solve the problem of inverse references between the JPA entities. However, since I am not calling the JAXB implementation myself, but WAS calls its own, the @XmlInverseReference annotation gets ignore. I don't want to use the @XmlTransient annotation since it is important for me to fetch all the referenced entities as method result.
Is it possible to use Moxy as default WebSphere JAXB implementation? Or, can I create JAXB adapters for my entities which would then at runtime add @XmlTransient annotations? I need this since I have methods which return the entities referencing other entities, but also returning the referenced entities with their references towards the sources of the database relationships.