Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » tranisent reference(model generation)
tranisent reference [message #501074] Mon, 30 November 2009 22:17 Go to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: November 2009
Junior Member
Hi,

I have an xsd with choice like this:

<xsd:complexType name="RootType" >
<xsd:complexContent>
<xsd:extension base="ns:SomeBaseType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="child" type="ns:ChildType"/>
</xsd:choice>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

The generated EMF model has the new xxPackageImpl class with initializePackageContents() method. It would
initialize the EClass for RootType. But the "child" becomes an EReference which is transient (with IS_TRANSIENT).

I checked that only if the XSD element under <choice> which is unbounded would be like that. If the XSD element is under a sequence or the choice is not unbounded, it would be !IS_TRANSIENT.

Is it as designed? Or is there any flag that I should use to avoid it?

Thanks.


Grace
Re: tranisent reference [message #501078 is a reply to message #501074] Mon, 30 November 2009 22:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30622
Registered: July 2009
Senior Member
Grace,

Comments below.

gracehylo@yahoo.com wrote:
> Hi,
>
> I have an xsd with choice like this:
>
> <xsd:complexType name="RootType" >
> <xsd:complexContent>
> <xsd:extension base="ns:SomeBaseType">
> <xsd:choice minOccurs="0" maxOccurs="unbounded">
> <xsd:element name="child" type="ns:ChildType"/>
> </xsd:choice>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> The generated EMF model has the new xxPackageImpl class with
> initializePackageContents() method. It would
> initialize the EClass for RootType. But the "child" becomes an
> EReference which is transient (with IS_TRANSIENT).
>
> I checked that only if the XSD element under <choice> which is
> unbounded would be like that. If the XSD element is under a sequence
> or the choice is not unbounded, it would be !IS_TRANSIENT.
Yes, I expect a repeating sequence or choice to result in a feature map,
which is non-transient and all other features to delegate to that
feature map and hence be transient.
>
> Is it as designed? Or is there any flag that I should use to avoid it?
The repeating choice with only one element is pointless even in the XML
Schema so I'd avoid that.
>
> Thanks.
>
>
> Grace
Previous Topic:Forward Cross References
Next Topic:[CDO] problems with savepoint and rollback
Goto Forum:
  


Current Time: Wed Nov 13 08:08:43 GMT 2019

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

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

Back to the top