Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to combine xml-inverse-reference with xml-element-ref for inhertance without xsi:type?
How to combine xml-inverse-reference with xml-element-ref for inhertance without xsi:type? [message #1560040] Mon, 12 January 2015 10:56 Go to next message
Vjacheslav Borisov is currently offline Vjacheslav BorisovFriend
Messages: 6
Registered: March 2014
Junior Member
I have found example how to setup inheritance without xsi:type using
<xml-element-ref> tag

stackoverflow.com/questions/8853855/jaxb-eclipselink-xmlrootelement-and-inheritance

But unfuruntately, xml-element-ref does not support xml-inverse-reference element.
My current example is

<xml-element java-attribute ="client">
<xml-inverse-reference mapped-by="relationMembers"/>
</xml-element>

But it results xsi:type in output:
<ns0:client xsi:type="ns0:PhysicalClientType">, <ns0:client xsi:type="ns0:JuridicalContactClientType">, but i want istead <PhysicalClient>, <JuridicalContactClient>.

How to setup xml-element-ref with xml-inverse-reference at the same time?
Re: How to combine xml-inverse-reference with xml-element-ref for inhertance without xsi:type? [message #1609484 is a reply to message #1560040] Tue, 10 February 2015 06:21 Go to previous messageGo to next message
Vjacheslav Borisov is currently offline Vjacheslav BorisovFriend
Messages: 6
Registered: March 2014
Junior Member
Also tried with xml-elements:
This example produces output without xsi:type:
<xml-elements java-attribute ="client">
<xml-element name="physicalClient" type="ru.ilb.meta.contacts.contactsbase.PhysicalClient"/>
<xml-element name="businessmanClient" type="ru.ilb.meta.contacts.contactsbase.BusinessmanClient"/>
<xml-element name="juridicalClient" type="ru.ilb.meta.contacts.contactsbase.JuridicalClient"/>
</xml-elements>

But I cannot configure xml-inverse-reference with it.
Specifying xml-inverse-reference in each xml-element is valid but does not work
Specifying xml-inverse-reference in xml-elements is invalid by schema.
Re: How to combine xml-inverse-reference with xml-element-ref for inhertance without xsi:type? [message #1609577 is a reply to message #1609484] Tue, 10 February 2015 07:49 Go to previous message
Vjacheslav Borisov is currently offline Vjacheslav BorisovFriend
Messages: 6
Registered: March 2014
Junior Member
finally found: xml-inverse-reference should follow xml-elements and then both works
<xml-elements java-attribute ="client">
<xml-element name="physicalClient" type="ru.ilb.meta.contacts.contactsbase.PhysicalClient"/>
<xml-element name="businessmanClient" type="ru.ilb.meta.contacts.contactsbase.BusinessmanClient"/>
<xml-element name="juridicalClient" type="ru.ilb.meta.contacts.contactsbase.JuridicalClient"/>
</xml-elements>
<xml-inverse-reference java-attribute ="client" mapped-by="relationMembers"/>
Previous Topic:Unable to import JoinFetch annotation in EclipseLink 2.5.2 in OSGi
Next Topic:JoinFetchType.INNER with spring data paging gives classcastexception
Goto Forum:
  


Current Time: Tue Sep 24 21:07:15 GMT 2024

Powered by FUDForum. Page generated in 0.03362 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top