| Ed   Sorry I posted to the wrong place, and thanks for 
your reply.   The current handling of a references has a side 
effect, of which you may or may not be aware:   In the generated editor, it is possible to move a 
node of a model from one place to another using cut-and-paste (Ctrl-X followed 
by Ctrl-V). If you do this on a node that is referenced by other parts of the 
model, the references appear to be intact after the cut-and-paste. However, if 
you then save and reload the model, the references have gone.   I assume this is because the cut is handled as a 
delete, and the paste as the creation if a new node. So after the cut-and-paste, 
there are then two versions of the node with identical properties, one visible 
and one invisible. The references that appear to be intact after the 
cut-and-paste are actually to the invisible version. This version is removed 
when you save and reload.   This seems to me misleading as a user gets the 
impression that the cut-and-paste has preserved the references whereas, in fact, 
it has not.   Rgds Ashley   
  ----- Original Message -----  Sent: Thursday, September 16, 2004 9:41 
  PM Subject: Re: [emf-dev] Handling 
  Referential Integrity 
 Ashely,
 
 My standard answer to questions on the mailing list is 
  to please ask the questions in the newsgroup instead.
 
 Bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=61639 
  tracks this issue.  We do plan to fix it but just haven't had the 
  time.
 
 The way we plan to go about 
  solving this is to use EcoreUtil.UsageCrossReferencer to find all uses of the 
  deleted object and then to create commands to remove those uses too.
 
 
 Ed Merks/Toronto/IBM@IBMCA
 mailto: 
  merks@xxxxxxxxxx
 905-413-3265  (t/l 969)
 
 
 
 
 
 
    
    
      | "Ashley at Metamaxim" 
        <ashley.mcneile@xxxxxxxxxxxxx> Sent by: emf-dev-admin@xxxxxxxxxxx
 09/16/2004 03:40 PM 
         
 | 
          
          
            | To | <emf-dev@xxxxxxxxxxx> |  
            | cc |  |  
            | Subject | [emf-dev] Handling 
              Referential Integrity |  
 
 |  
 
 Hi
 
 I am a new user of EMF, and am looking for information 
  concerning handling referential integrity in EMF (specifically, in the editor 
  that EMF generates for a model).
 
 In April of this year, there 
  was a posting to [news.eclipse.tools.emf] by Sugato Bagchi on this 
  subject.
 
 Ed Merks replied to Sugato with:
 
 > The model knows nothing 
  about delete; it's not a model concept.  In the editor,
 > when you 
  do delete, it just removes the object from its container making it
 > 
  unreachable.  It would be very nice for the framework to handle
 > 
  cleanup-all-references on delete automatically, wouldn't it?  Feel free 
  to open
 > a bugzilla feature request and we'll look into it (but it will 
  take us quite
 > some time probably).
 
 In the application I am 
  building with EMF, this lack of referential integrity is a problem. At 
  present, if you delete an object in the generated editor, references to it 
  remain intact. However if you then save and reload the model, the references 
  disappear. I don't think that save and reload should cause this kind of change 
  to the state of the model. What I need is for the references to be cleaned up 
  at the time of the delete.
 
 I have looked in the EMF bug/desired feature list, 
  but this does not seem to registered as either a bug or a feature request. But 
  maybe it is there, and I just did not look in the right place! What I need to 
  know is:
 
 1. Has this been registered as an issue, and are there any plans to fix 
  it?
 
 2. If not, where can I get an example of the code I would need to write 
  to handle referential integrity myself?
 
 With thanks
 Ashley
 
 Ashley McNeile
 Metamaxim Ltd.
 email: 
  ashley.mcneile@xxxxxxxxxxxxx
 web: www.metamaxim.com
 
 |