Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [CDO 0.8.0] eDirectResource return always NULL
[CDO 0.8.0] eDirectResource return always NULL [message #122904] Thu, 22 May 2008 23:41 Go to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
I tried to complete my automatic persistence mechanism,

I have one case I do not handle and it seems to be because one value in
BasicEObject that is not set properly. In fact it is never set.

eDirectResource is always null when we use CDO. Did we never want to set it
? (when we attach an object and/or when we load an object) ?

Usually it is set when we attach an object to a resource...

Simon
Re: [CDO 0.8.0] eDirectResource return always NULL [message #122907 is a reply to message #122904] Fri, 23 May 2008 07:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

Hi Simon,

I'm not really sure about the expected semantics of eDirectResource and
eInternalResource. The JavaDoc is not very helpful:

/**
* Returns the containing resource, or <code>null</code>.
*/
Resource eResource();

/**
* Returns the containing internal resource, or <code>null</code>.
*/
Resource.Internal eInternalResource();

/**
* Returns the directly containing internal resource, or
<code>null</code>.
*/
Resource.Internal eDirectResource();

As I understand it, there are basically two approaches to determine the
resource of an object:
1) walk up the containment relationship (eContainer) until that is null
(top level object) then return its resource (eDirectResource)
2) A non-top level object has for some reasons directly stored its
resource (eDirectResource), then return it (or null)

eResource() is just a public wrapper for the eInternalResource() which
does 1)
eDirectResource() does 2)

If that's correct, I'd say for most non-top level objects
eDirectResource() would return something (null) different from
eInternalResource() and eResource().

Ed, is that correct?
Can you please explain how these methods relate/differ to/from each other?

In any way a CDOObjectImpl should behave exactly according to the
sematics implied by EObject and InternalEObject. If that is not the
case, please file a Bugzilla.

Cheers
/Eike


Simon McDuff schrieb:
> I tried to complete my automatic persistence mechanism,
>
> I have one case I do not handle and it seems to be because one value in
> BasicEObject that is not set properly. In fact it is never set.
>
> eDirectResource is always null when we use CDO. Did we never want to set it
> ? (when we attach an object and/or when we load an object) ?
>
> Usually it is set when we attach an object to a resource...
>
> Simon
>
>
>
Re: [CDO 0.8.0] eDirectResource return always NULL [message #122910 is a reply to message #122907] Fri, 23 May 2008 10:49 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is not the case.

I will fill a bugzilla! (I tested my stuff with XMIResourceImpl and do not
behave the same way!)


"Eike Stepper" <stepper@sympedia.de> a
Re: [CDO 0.8.0] eDirectResource return always NULL [message #122914 is a reply to message #122910] Fri, 23 May 2008 10:55 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=233644

"Simon McDuff" <smcduff@hotmail.com> a
Re: [CDO 0.8.0] eDirectResource return always NULL [message #618155 is a reply to message #122904] Fri, 23 May 2008 07:01 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Simon,

I'm not really sure about the expected semantics of eDirectResource and
eInternalResource. The JavaDoc is not very helpful:

/**
* Returns the containing resource, or <code>null</code>.
*/
Resource eResource();

/**
* Returns the containing internal resource, or <code>null</code>.
*/
Resource.Internal eInternalResource();

/**
* Returns the directly containing internal resource, or
<code>null</code>.
*/
Resource.Internal eDirectResource();

As I understand it, there are basically two approaches to determine the
resource of an object:
1) walk up the containment relationship (eContainer) until that is null
(top level object) then return its resource (eDirectResource)
2) A non-top level object has for some reasons directly stored its
resource (eDirectResource), then return it (or null)

eResource() is just a public wrapper for the eInternalResource() which
does 1)
eDirectResource() does 2)

If that's correct, I'd say for most non-top level objects
eDirectResource() would return something (null) different from
eInternalResource() and eResource().

Ed, is that correct?
Can you please explain how these methods relate/differ to/from each other?

In any way a CDOObjectImpl should behave exactly according to the
sematics implied by EObject and InternalEObject. If that is not the
case, please file a Bugzilla.

Cheers
/Eike


Simon McDuff schrieb:
> I tried to complete my automatic persistence mechanism,
>
> I have one case I do not handle and it seems to be because one value in
> BasicEObject that is not set properly. In fact it is never set.
>
> eDirectResource is always null when we use CDO. Did we never want to set it
> ? (when we attach an object and/or when we load an object) ?
>
> Usually it is set when we attach an object to a resource...
>
> Simon
>
>
>


Re: [CDO 0.8.0] eDirectResource return always NULL [message #618156 is a reply to message #122907] Fri, 23 May 2008 10:49 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
This is not the case.

I will fill a bugzilla! (I tested my stuff with XMIResourceImpl and do not
behave the same way!)


"Eike Stepper" <stepper@sympedia.de> a
Re: [CDO 0.8.0] eDirectResource return always NULL [message #618158 is a reply to message #122910] Fri, 23 May 2008 10:55 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=233644

"Simon McDuff" <smcduff@hotmail.com> a
Previous Topic:[CDO 0.8.0] eDirectResource return always NULL
Next Topic:[CDO 0.8.0] Performance
Goto Forum:
  


Current Time: Fri Apr 26 05:31:53 GMT 2024

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

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

Back to the top