Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (FIXED) no factory method for my generated EObject with containment reference
(FIXED) no factory method for my generated EObject with containment reference [message #655017] Fri, 18 February 2011 00:54 Go to next message
Tom H is currently offline Tom HFriend
Messages: 136
Registered: July 2009
Senior Member

Edit: turns out I had set the class to abstract.

I have defined 2 Eclasses Statement and StatementLine with a containment reference like so;


<eClassifiers xsi:type="ecore:EClass" name="Statement" abstract="true">
...
<eStructuralFeatures xsi:type="ecore:EReference" name="statementLines" upperBound="-1"
eType="#//StatementLine" containment="true" eOpposite="#//StatementLine/statement"/>
...
<eStructuralFeatures xsi:type="ecore:EAttribute" name="currency" eType="#//currency"/>
</eClassifiers>


<eClassifiers xsi:type="ecore:EClass" name="StatementLine" eSuperTypes="#//IStatement">
...
<eStructuralFeatures xsi:type="ecore:EAttribute" name="currency" eType="#//currency"/>
...
<eStructuralFeatures xsi:type="ecore:EReference" name="statement" eType="#//Statement"
eOpposite="#//Statement/statementLines"/>
</eClassifiers>


and after generating the model code, I have the Statement and StatementImpl EObjects and EObjectImpl as expected. However there is no createStatement() method in the AccountingFactoryImpl

Any suggestions on how I create new instances of the Composite Statement object?

Thanks,
T


[Updated on: Fri, 18 February 2011 01:19]

Report message to a moderator

Re: no factory method for my generated EObject with containment reference [message #655186 is a reply to message #655017] Fri, 18 February 2011 15:13 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NOSPAM.ibm.com

Hi,

On 2/17/2011 7:54 PM, Tom H wrote:
> I have defined 2 Eclasses Statement and StatementLine with a containment
> reference like so;
>
>
> <eClassifiers xsi:type="ecore:EClass" name="Statement" abstract="true">
> ..

Statement is listed as abstract. You can't "create" an instance of an
abstract class. You can only create a subclass of it.


--
Thanks,
Rich Kulp
Previous Topic:[CDO] website, 1 point for improvement
Next Topic:Resource unload doenst free memory?
Goto Forum:
  


Current Time: Thu Oct 24 04:58:31 GMT 2019

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

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

Back to the top