Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » isComposite and isId usage ?
isComposite and isId usage ? [message #431498] Tue, 14 July 2009 07:34 Go to next message
gitanjali punj is currently offline gitanjali punjFriend
Messages: 59
Registered: July 2009
Member
Hi,
I have a piece of code which is like this in emof form:

<?xml version="1.0" encoding="ASCII"?>
<http..schema.omg.org.spec.mof.2.0.emof.xmi:Package xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:http..schema.omg.org.spec.mof.2.0.emof.xmi="http://schema.omg.org/spec/mof/2.0/emof.xmi"
xmi:id="52f8f618a87fa09e-fa530014308425db" name="demo1" uri="demo1">
<ownedType xmi:type="http..schema.omg.org.spec.mof.2.0.emof.xmi:Class"
xmi:id="ac0e71bc79c947d3-b7218d94f8a048e" name="a">
<ownedAttribute xmi:id="7121ffbf696ffc1d-a98b40ab37b25392" name="a1"
isComposite="true" lower="0" upper="-1"
opposite="651e805d78e316a4-62f43bd50dec76bd"
type="2cd2fd45437ed37b-cca79a448b73c6a"/>
</ownedType>
<ownedType xmi:type="http..schema.omg.org.spec.mof.2.0.emof.xmi:Class"
xmi:id="2cd2fd45437ed37b-cca79a448b73c6a" name="b">
<ownedAttribute xmi:id="651e805d78e316a4-62f43bd50dec76bd" name="b1"
isID="true" lower="0" upper="-1"
opposite="7121ffbf696ffc1d-a98b40ab37b25392"
type="ac0e71bc79c947d3-b7218d94f8a048e"/>
</ownedType>
</http..schema.omg.org.spec.mof.2.0.emof.xmi:Package>

Now from the data it is visible that only a1 of a has isComposite="true"
but when I paste this in emf and validate it gives an error saying
"opposite of a containmemnt reference must not be a containment
reference".Automatically its making both sides as isComposite="true".
But when i remove the isId feature from b1 it takes only 1 side as
isComposite="true".
Can you explain me what is the realation between isId and isComposite ?
And this behaviour is seen only when both sides of the association are
navigable ?
Re: isComposite and isId usage ? [message #431510 is a reply to message #431498] Tue, 14 July 2009 15:06 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
It's not possible for a reference to be an ID and this bogus isID
attribute is confusing the deserializer.


gitanjali punj wrote:
> Hi,
> I have a piece of code which is like this in emof form:
>
> <?xml version="1.0" encoding="ASCII"?>
> <http..schema.omg.org.spec.mof.2.0.emof.xmi:Package xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:http..schema.omg.org.spec.mof.2.0.emof.xmi="http://schema.omg.org/spec/mof/2.0/emof.xmi"
> xmi:id="52f8f618a87fa09e-fa530014308425db" name="demo1" uri="demo1">
> <ownedType xmi:type="http..schema.omg.org.spec.mof.2.0.emof.xmi:Class"
> xmi:id="ac0e71bc79c947d3-b7218d94f8a048e" name="a">
> <ownedAttribute xmi:id="7121ffbf696ffc1d-a98b40ab37b25392"
> name="a1" isComposite="true" lower="0" upper="-1"
> opposite="651e805d78e316a4-62f43bd50dec76bd"
> type="2cd2fd45437ed37b-cca79a448b73c6a"/>
> </ownedType>
> <ownedType
> xmi:type="http..schema.omg.org.spec.mof.2.0.emof.xmi:Class"
> xmi:id="2cd2fd45437ed37b-cca79a448b73c6a" name="b">
> <ownedAttribute xmi:id="651e805d78e316a4-62f43bd50dec76bd"
> name="b1" isID="true" lower="0" upper="-1"
> opposite="7121ffbf696ffc1d-a98b40ab37b25392"
> type="ac0e71bc79c947d3-b7218d94f8a048e"/>
> </ownedType>
> </http..schema.omg.org.spec.mof.2.0.emof.xmi:Package>
>
> Now from the data it is visible that only a1 of a has
> isComposite="true" but when I paste this in emf and validate it gives
> an error saying "opposite of a containmemnt reference must not be a
> containment reference".Automatically its making both sides as
> isComposite="true".
> But when i remove the isId feature from b1 it takes only 1 side as
> isComposite="true".
> Can you explain me what is the realation between isId and isComposite ?
> And this behaviour is seen only when both sides of the association are
> navigable ?
>
>
>
Previous Topic:Copy of generated model
Next Topic:[CDO] Session busy indicator
Goto Forum:
  


Current Time: Sat Dec 14 15:21:26 GMT 2019

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

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

Back to the top