Hi Dan,

An example of a generated class (and some automatically generated methods) is

public abstract class Adaptation extends Ancestor {

        @Override
        public NotificationChain eInverseAdd(InternalEObject otherEnd, int 
featureID, NotificationChain msgs) {
                switch (featureID) {
                        case AnidirectoryPackage.ADAPTATION__ADAPTATION_OF:
                                if (adaptationOf != null)
                                        msgs = 
((InternalEObject)adaptationOf).eInverseRemove(this, 
AnidirectoryPackage.IP__ADAPTATIONS, IP.class, msgs);
                                return basicSetAdaptationOf((IP)otherEnd, msgs);
                }
                return super.eInverseAdd(otherEnd, featureID, msgs);
        }

        @Override
        public NotificationChain eInverseRemove(InternalEObject otherEnd, int 
featureID, NotificationChain msgs) {
                switch (featureID) {
                        case AnidirectoryPackage.ADAPTATION__ADAPTATION_OF:
                                return basicSetAdaptationOf(null, msgs);
                }
                return super.eInverseRemove(otherEnd, featureID, msgs);
        }
}

As you can see, this has some references to AnidirectoryPackage.

public class AnidirectoryPackage extends EPackageImpl {
/**
         * Returns the meta object for the reference '{@link 
dom.anidirectory.AdaptationCharacter#getBelongingTo <em>Belonging To</em>}'.
         * <!-- begin-user-doc -->
         * <!-- end-user-doc -->
         * @return the meta object for the reference '<em>Belonging To</em>'.
         * @see dom.anidirectory.AdaptationCharacter#getBelongingTo()
         * @see #getAdaptationCharacter()
         * @generated
         */
        public EReference getAdaptationCharacter_BelongingTo() {
                return 
(EReference)adaptationCharacterEClass.getEStructuralFeatures().get(0);
        }

        /**
         * Returns the meta object for the attribute '{@link 
dom.anidirectory.AdaptationCharacter#getSurname <em>Surname</em>}'.
         * <!-- begin-user-doc -->
         * <!-- end-user-doc -->
         * @return the meta object for the attribute '<em>Surname</em>'.
         * @see dom.anidirectory.AdaptationCharacter#getSurname()
         * @see #getAdaptationCharacter()
         * @generated
         */
        public EAttribute getAdaptationCharacter_Surname() {
                return 
(EAttribute)adaptationCharacterEClass.getEStructuralFeatures().get(1);
        }
}

If that doesn't help, just say so.

Thanks again,

- Iain

On 8 Jul 2011, at 22:10, Dan Haywood wrote:

> Thanks for all the detail, but I can't quite visualise it. Can you paste some 
> source files with all the different bits (ie a small test case that exhibits 
> the problem)? 
> 
> Thx
> Dan
> 
> Sent from my iPhone
> 
> On 8 Jul 2011, at 21:02, Iain Flynn <[email protected]> wrote:
> 
>> Hi Kevin,
>> 
>> The wrapper is a class containing Isis methods that has an empty subclass of 
>> AbstractDomainObject has an inner class, an instance of which it has as an 
>> attribute. The wrapper has the ADO methods and calls the inner object to 
>> take care of them.
>> 
>> (I've actually discovered since last time that this wrapper may well not be 
>> necessary, but I don't have reason to believe that's relevant here.)
>> 
>> EMF generates a class for each domain object I feed into it. These classes 
>> have the attributes and operations I specify, as well as some EMF helper 
>> methods.
>> 
>> EMF also generates two classes for the model, known in my project as 
>> AnidirectoryFactory and AnidirectoryPackage. The latter is the one using the 
>> EMF class (EResource) that has the reference to addAll().
>> 
>> The AnidirectoryPackage, to paraphrase the provided description, contains 
>> accessors to the classes and their operations, features, and datatypes for 
>> use by EMF's metamodel.
>> 
>> As this class is the one with the offending reference, does this sound like 
>> something to try composition with? It does use EResource as a return value, 
>> but I don't believe the generated classes make any references to it.
>> 
>> Thank you again for your help,
>> 
>> - Iain Flynn.

Reply via email to