HyperJAXB和IDREF [英] HyperJAXB and IDREFs

查看:104
本文介绍了HyperJAXB和IDREF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最终设法调整HyperJAXB,以便当XSD具有complexType A并且它具有到complexType B的IDREF时,HyperJAXB将在两个生成的实体之间生成@OneToOne JPA注释。

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.

然而现在我面临另一个问题:XSD有复杂的X型,可以IDREF复杂的Y型或复杂的Z型。最后,我需要复杂类型X的实例包含对任一实例的引用Y类或Z类。

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.

如果不对生成的类进行手动更改,您是否有任何疯狂的想法?同时确保将这些实体编组为正确的XML?

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?

如何使用允许生成类的JAXB插件来实现特定的接口?可以在任何地方领先吗?

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

推荐答案

HJ2支持JAXB1的idsSymbolSpace功能。在JAXB2中,它以不同的方式完成(我认为使用jaxb:class,但我不确定)。 HJ3还不支持,问题在于:

HJ2 supported the "idsSymbolSpace" feature of JAXB1. In JAXB2 it's done in a different way (I think with jaxb:class, but I'm not sure). HJ3 does not support it yet, here's the issue:

http://jira.highsource.org/browse/HJIII-53

这篇关于HyperJAXB和IDREF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆