Home » Modeling » EMF » problem with SetCommand
problem with SetCommand [message #417038] |
Sun, 24 February 2008 00:14 |
Charles H Martin Messages: 79 Registered: July 2009 |
Member |
|
|
Hi
I seem to be misunderstanding something very basic with the EMF Edit/Command framework
I have an EObject, OptionChain, that contains another EObject, Asset
I want to create the Asset EObject and add it to the OptionChain.
So I tried using:
SetCommand.create(domain, chain, MjtPackage.eINSTANCE
.getOptionChain_Asset(), asset);
And this does work, except when I try to save the resource, I get the exception:
Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'mjt.impl.AssetImpl@2f5dda (type: Stock, ticker: GOOG, price: 500.59, amount: 0.0, fakeAmount: 0.0)' is not contained in a resource.
What did I do wrong?
|
|
|
Re: problem with SetCommand [message #417042 is a reply to message #417038] |
Sun, 24 February 2008 13:08 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------000909050506050701060005
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Charles,
I added a new FAQ entry for this:
2.18 I get a DanglingHREFException: e.g.,
"org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
'com.example.Foo@2f5dda ()' is not contained in a resource." What do
I need to do?
< http://wiki.eclipse.org/EMF/FAQ#I_get_a_DanglingHREFExceptio n:_e.g..2C_.22org.eclipse.emf.ecore.xmi.DanglingHREFExceptio n:_The_object_.27com.example.Foo.402f5dda_.28.29.27_is_not_c ontained_in_a_resource..22_What_do_I_need_to_do.3F>
Charles Martin wrote:
> Hi
>
> I seem to be misunderstanding something very basic with the EMF Edit/Command framework
>
> I have an EObject, OptionChain, that contains another EObject, Asset
>
> I want to create the Asset EObject and add it to the OptionChain.
> So I tried using:
>
> SetCommand.create(domain, chain, MjtPackage.eINSTANCE
> .getOptionChain_Asset(), asset);
>
>
> And this does work, except when I try to save the resource, I get the exception:
>
> Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'mjt.impl.AssetImpl@2f5dda (type: Stock, ticker: GOOG, price: 500.59, amount: 0.0, fakeAmount: 0.0)' is not contained in a resource.
>
> What did I do wrong?
>
--------------000909050506050701060005
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Charles,<br>
<br>
I added a new FAQ entry for this:<br>
<blockquote><a
href=" http://wiki.eclipse.org/EMF/FAQ#I_get_a_DanglingHREFExceptio n:_e.g..2C_.22org.eclipse.emf.ecore.xmi.DanglingHREFExceptio n:_The_object_.27com.example.Foo.402f5dda_.28.29.27_is_not_c ontained_in_a_resource..22_What_do_I_need_to_do.3F"><span
class="tocnumber">2.18</span> <span class="toctext">I
get a DanglingHREFException: e.g.,
"org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
'com.example.Foo@2f5dda ()' is not contained in a resource." What do I
need to do?</span></a><br>
</blockquote>
<br>
Charles Martin wrote:
<blockquote
cite="mid:7765440.13731203812124740.JavaMail.root@cp1.dzone.com"
type="cite">
<pre wrap="">Hi
I seem to be misunderstanding something very basic with the EMF Edit/Command framework
I have an EObject, OptionChain, that contains another EObject, Asset
I want to create the Asset EObject and add it to the OptionChain.
So I tried using:
SetCommand.create(domain, chain, MjtPackage.eINSTANCE
.getOptionChain_Asset(), asset);
And this does work, except when I try to save the resource, I get the exception:
Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'mjt.impl.AssetImpl@2f5dda (type: Stock, ticker: GOOG, price: 500.59, amount: 0.0, fakeAmount: 0.0)' is not contained in a resource.
What did I do wrong?
</pre>
</blockquote>
<br>
</body>
</html>
--------------000909050506050701060005--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Apr 25 23:14:22 GMT 2024
Powered by FUDForum. Page generated in 0.03273 seconds
|