Home » Modeling » EMF » EcoreUtil.copy problem with CDO(Copied set ends up in eSettings rather than associated with the attribute name.)
| | | |
Re: EcoreUtil.copy problem with CDO [message #1719246 is a reply to message #1718464] |
Wed, 06 January 2016 14:44 |
Paul C. Brown Messages: 18 Registered: October 2013 |
Junior Member |
|
|
Ed,
I am a little confused about what code is supposed to be generated when Reflective is the feature generation choice. For example, I have a model relation commonNameLiteral that is Derived, Transient, and Volatile. Yet when I generate the code (configured for CDO) I get:
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Literal getCommonNameLiteral() {
return (Literal)eGet(CRLPackage.Literals.ELEMENT__COMMON_NAME_LITERAL, true);
}
I expected some kind of placeholder code here. Of course I can mark this as NOT generated and put my own code in, but I am concerned that other things will not be working. In particular, there seems to be some assumption that the eGet with these arguments will return the commonNameLiteral. If I simply rewrite the getCommonNameLiteral() method, this is not going to make the eGet() call work if called elsewhere. What am I missing?
[Updated on: Wed, 06 January 2016 14:45] Report message to a moderator
|
|
|
Re: EcoreUtil.copy problem with CDO [message #1719253 is a reply to message #1719246] |
Wed, 06 January 2016 15:45 |
Ed Merks Messages: 33223 Registered: July 2009 |
Senior Member |
|
|
Paul,
Yes, sorry I got it exactly backward. For Dyanmic delegation, an eGet
is generated that calls the generated accessor, so you have proper hooks
where to specialize the code. For Reflective delegation, which is more
efficient because it completely bypasses the generated accessors, there
are no such hooks. Does that leave you with your original problem?
(I'll be away until next Monday, so follow up help won't be quick.)
On 06/01/2016 3:44 PM, Paul C. Brown wrote:
> Ed,
>
> I am a little confused about what code is supposed to be generated
> when Rflective is the feature generation choice. For example, I have a
> model relation commonNameLiteral that is Derived, Transient, and
> Volatile. Yet when I generate the code (configured for CDO) I get:
>
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public Literal getCommonNameLiteral() {
> return
> (Literal)eGet(CRLPackage.Literals.ELEMENT__COMMON_NAME_LITERAL, true);
> }
>
> I expected some kind of placeholder code here. Of course I can mark
> this as NOT generated and put my own code in, but I am concerned that
> other things will not be working. In particular, there seems to be
> some assumption that the eGet with these arguments will return the
> commonNameLiteral. If I simply rewrite the getCommonNameLiteral()
> method, this is not going to make the eGet() call work if called
> elsewhere. What am I missing?
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: EcoreUtil.copy problem with CDO [message #1719844 is a reply to message #1719764] |
Tue, 12 January 2016 14:50 |
Ed Merks Messages: 33223 Registered: July 2009 |
Senior Member |
|
|
Paul,
You can open a bugzilla against the EMF project's Tools component. It's
not so likely to get attention without an associated Gerrit contribution.
On 11/01/2016 10:21 PM, Paul C. Brown wrote:
> Ed,
>
> I thought I had updated this, but my posting did not appear. I removed
> all my @generated NOT customizations, regenerated, and then modified
> the get<X>, basicGet<X> and set<X> methods for my derived, transient,
> and volatile references. Copy now works.
>
> It sure would be useful if the generated code for these three methods
> generated placeholders rather than finished code. It was less than
> clear that all three need to be updated (I thought the get<X> methods
> would call the basicGet<X> methods behind the scenes). How should I
> make this request (i.e. to what project)?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Sat Oct 05 10:02:27 GMT 2024
Powered by FUDForum. Page generated in 0.03544 seconds
|