[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.ocl] Re: Using OCL to specify derived References (NOT attributes)

I think I found one (of probably many) errors... I guess should not be
using the SubsetSupersetEObjectContainmentWithInverseEList for the
subset association (between Table and Columns) , but just a
SubsetSupersetEObjectWithInverseEList (i.e. no containment).
I am also not sure if passing a null for the feature id arrays is a good
idea, I replaced it with an empty array. Still, I now get
NullPointerExceptions when my code tries to remove content from a
container. The code in question is removing a content that is NOT a
column, i.e., is part of a relationship that I have not yet converted to
the UML2 ELists. Could this be a problem?

JG wrote:

> *********************************************************
> protected static final int[] COLUMN_SET_ESUPERSETS =
> 	new int[]{CorePackage.NAMESPACE__CONTENT};
> 		
> public EList getColumns() {
> 	if (columns == null) {
> //columns = new EObjectWithInverseResolvingEList(Column.class,
> //this, RelationalPackage.COLUMN_SET__COLUMNS,
> //RelationalPackage.COLUMN__COLUMN_SET);
> 			
> columns = new SubsetSupersetEObjectContainmentWithInverseEList(
> 	Column.class, //(Class dataClass,
> 	this, //InternalEObject owner,
> 	RelationalPackage.COLUMN_SET__COLUMNS, //int featureID,
> 	COLUMN_SET_ESUPERSETS, //int[] supersetFeatureIDs,
> 	null, //int[] subsetFeatureIDs
> 	RelationalPackage.COLUMN__COLUMN_SET);//, int inverseFeatureID)
> 	}
> return columns;
> }
> *********************************************************