Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Delete Model from an resource
Delete Model from an resource [message #508364] Mon, 18 January 2010 15:04 Go to next message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

Hi all,
I have model like this :
EmailAccount
- list of mailFolder
- MailFolder contains list of SubFolder and mailentry

When i delete emailaccount, mailfolder and mailentry not delete from resource, can somebody tell me how to delete all reference automatically when delete the parent ??

Thanks,
CanA


Re: Delete Model from an resource [message #508401 is a reply to message #508364] Mon, 18 January 2010 16:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
CanA,

It's hard to know from your description where the containment references
are. I'm not sure if you're even talking about a DeleteCommand or
EcoreUtil.delete. In any case, if EMailAccount contained all these
other things then deleting it would delete all the contained children as
well.


Rencana Tarigan wrote:
> Hi all,
> I have model like this :
> EmailAccount
> - list of mailFolder
> - MailFolder contains list of SubFolder and mailentry
>
> When i delete emailaccount, mailfolder and mailentry not delete from
> resource, can somebody tell me how to delete all reference
> automatically when delete the parent ??
>
> Thanks,
> CanA
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Delete Model from an resource [message #508521 is a reply to message #508401] Tue, 19 January 2010 10:14 Go to previous messageGo to next message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

Thanks for reply Ed,

I have object :
EmailAccount
EmailFolder
EmailEntry

and i have 1 resource for each model..
EmailAccount :
- mailFolder : EmailFolder (cardinality 1...*)

MailFolder :
- mailEntry : EmailEntry (cardinality 1...*)

what i'm doing now is, when i delete EmailAccount from resource, i must delete mailEntry from all mailFolder first and then delete emailaccount and than commit the transaction..

is there a way that all of reference will be deleted automatically from resource ?


Re: Delete Model from an resource [message #508598 is a reply to message #508521] Tue, 19 January 2010 14:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
CanA,

Comments below.

Rencana Tarigan wrote:
> Thanks for reply Ed,
>
> I have object : EmailAccount
> EmailFolder
> EmailEntry
>
> and i have 1 resource for each model..
> EmailAccount :
> - mailFolder : EmailFolder (cardinality 1...*)
>
> MailFolder : - mailEntry : EmailEntry (cardinality 1...*)
>
> what i'm doing now is, when i delete EmailAccount from resource, i
> must delete mailEntry from all mailFolder first and then delete
> emailaccount and than commit the transaction..
Again, I don't know if you are using commands.
>
> is there a way that all of reference will be deleted automatically
> from resource ?
It's still not so clear where your containment references are...


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView?
Next Topic:Using MyItemProvider commands in my editors
Goto Forum:
  


Current Time: Fri Apr 19 20:48:58 GMT 2024

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

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

Back to the top