| Summary: | feature with unique=false implemented by unique list | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Nicolas Bros <nicolas.bros> |
| Component: | Core | Assignee: | Ed Merks <Ed.Merks> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 2.7.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 89325 *** For future reference, a workaround is to override isUnique on the returned list (and mark the method @generated NOT):
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public EList<Class2> getNaryReference_notUnique() {
if (this.naryReference_notUnique == null) {
this.naryReference_notUnique = new EObjectResolvingEList<Class2>(Class2.class, this, SamplemmPackage.CLASS1__NARY_REFERENCE_NOT_UNIQUE) {
@Override
protected boolean isUnique() {
return false;
}
};
}
return this.naryReference_notUnique;
}
|
I have a metamodel with a feature on which "unique" is false : <eStructuralFeatures xsi:type="ecore:EReference" name="naryReference_notUnique" unique="false" upperBound="-1" eType="#//Class2"/> EMF Generates this implementation for this feature's getter: public EList<Class2> getNaryReference_notUnique() { if (naryReference_notUnique == null) { naryReference_notUnique = new EObjectResolvingEList<Class2>(Class2.class, this, SamplemmPackage.CLASS1__NARY_REFERENCE_NOT_UNIQUE); } return naryReference_notUnique; } On EObjectResolvingEList, the method isUnique() (inherited from EObjectEList) returns true.