Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Deletion of entities does not unset the non-containment references
Deletion of entities does not unset the non-containment references [message #731811] Mon, 03 October 2011 07:32 Go to next message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Hi,

I have the following Scenario:

A has a non-containment reference to B. Now if I use a RemoveCommand on B, its reference from A is not automatically unset, hence leaving some dangling references.

How can I ensure that all the references are also deleted on deleting an object.

Thanks,
Best Regards,
Nidhi

[Updated on: Mon, 03 October 2011 07:36]

Report message to a moderator

Re: Deletion of entities does not unset the non-containment references [message #731947 is a reply to message #731811] Mon, 03 October 2011 14:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Nidhi,<br>
<br>
Is this constructor for the delete action being called with true as
the second argument?<br>
<br>
<small>  public DeleteAction(EditingDomain domain, boolean
removeAllReferences)<br>
</small><br>
That will ensure that as DeleteCommand rather than a RemoveCommand
is used.<br>
<br>
<small>  public Command createCommand(Collection&lt;?&gt; selection)<br>
  {<br>
    return removeAllReferences ? DeleteCommand.create(domain,
selection) : RemoveCommand.create(domain, selection);<br>
  }<br>
</small><br>
<br>
On 03/10/2011 12:32 AM, Nidhi wrote:
<blockquote cite="mid:j6bno1$6tv$1@news.eclipse.org" type="cite">Hi,
<br>
<br>
I have the following Scenario:
<br>
<br>
A has a non-containment reference to B. Now if I use a
DeleteCommand on B, its reference from A is not automatically
unset, hence leaving some dangling references.
<br>
<br>
How can I ensure that all the references are also deleted on
deleting an object.
<br>
<br>
Thanks,
<br>
Best Regards,
<br>
Nidhi
<br>
<br>
</blockquote>
</body>
</html>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Deletion of entities does not unset the non-containment references [message #733532 is a reply to message #731947] Wed, 05 October 2011 00:34 Go to previous message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Thanks Ed,
It works now.

Best Regards,
Nidhi
Previous Topic:Multiple xsd:restrictions
Next Topic:Missing Update Site
Goto Forum:
  


Current Time: Thu Apr 25 22:18:08 GMT 2024

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

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

Back to the top