HyperJAXB and IDREFs

Posted by finrod on Stack Overflow See other posts from Stack Overflow or by finrod
Published on 2010-06-07T22:34:26Z Indexed on 2010/06/08 6:02 UTC
Read the original article Hit count: 343

Filed under:
|
|
|

I have eventually managed to fiddle HyperJAXB so that when XSD has complexType A and this has an IDREF to complexType B, then HyperJAXB will generate @OneToOne JPA annotations between the the two generated entities.

However now I'm facing another problem: the XSD has complex type X that can IDREF to either complex type Y or complex type Z. In the end, I need instance of complex type X contain reference to either instance of class Y or class Z.

Do you have any wild ideas how can this be done without manual alterations to the generated classes? And at the same time to make sure these entities are marshalled to a correct XML?

How about using the JAXB plugin that allows generating classes so that they implement a particular interface? Could that lead anywhere?

© Stack Overflow or respective owner

Related posts about java

Related posts about jpa