[CDO] CDOObject containment problems [message #425915] |
Thu, 11 December 2008 12:11  |
Eclipse User |
|
|
|
Hi all,
I have a problem with resources in CDO. I have the following EMF model :
Data
name : String
Folder -> Datas
contents : 0..* Datas (containment = true)
File -> Data
The model is composed of Datas, a Data can be a Folder or a File. A
Folder can contains Datas, i.e. Files and Folders
I have a first resource : resource1 wich contains a instance of a File :
myFile
I have a second resource : resource2 which contains a instance of a
Folder : myFolder.
When I add myFile (of resource1) in myFolder (of resource2) it is
automatically removed from resource1. It is done in eBasicSetContainer
method of CDOObjectImpl class.
It seems that it works with pure EMF Resources. How can I manage this
kind of containment with CDO ?
David
|
|
|
|
|
|
|
|
|
|
Re: [CDO] CDOObject containment problems [message #425977 is a reply to message #425936] |
Mon, 15 December 2008 03:25  |
Eclipse User |
|
|
|
I created a bugzilla with a Junit Test Case :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258780
David
Simon McDuff a écrit :
> I've created a testcases and it worked... so I don't know what is
> missing... Could you send me your .ecore and .genmodel ? (or the all
> project) (you can open a buzilla :-))
>
> Can you tell me which version of CDO you are using ?
>
> Simon
>
> David Bonneau wrote:
>> Simon McDuff a écrit :
>>> hi David,
>>>
>>> Does containment = true is set for the relationship: myFolder->myFile ?
>>
>> Yes
>>
>>>
>>> Simon
>>>
>>>
>>> David Bonneau wrote:
>>>> Simon, Eike, thanks for your help !
>>>>
>>>> In my genmodel Containment Proxies property was false. I set it to
>>>> true and now it works :)
>>>>
>>>> Now I have an exception : Unable to provideCDOID. I think it's me,
>>>> I'm doing things wrong.
>>>>
>>>> I have on transaction where I create
>>>> - a Folder : myFolder
>>>> - a Resource : fileResource
>>>> - a File : myFile
>>>> - I add myFile in fileResource : fileResource -> myFile
>>>> - commit : OK
>>>> - I add myFile in myFolder : fileResource -> myFile <- myFolder
>>>> - commit : ! OK : unable to provideCDOID: fr.exemple.FolderImpl
>>>>
>>>> I think, I understand why I have an exception : the CDOObject
>>>> myFolder doesn't belong to a Resource, if I do it, it works.
>>>>
>>>> Is it a bug ?
>>>>
>>>> David
>>>>
>>>>
|
|
|
Powered by
FUDForum. Page generated in 0.25508 seconds