Community
Participate
Working Groups
Right now, the creation of associations is connected to the org.eclipse.uml2.Type interface (which is subinterfaced in eg. org.eclipse.uml2.Class). However finding associations, in which a class is involved is difficult, because the getAssociation method resides in the org.eclipse.uml2.Property interface. As a consequence, in the case of not-navigable associations iterating through the attributes of a given class does not give correct results. Considering that an association can be moved inside the model wherever you want in worst case you should iterate all of the associations in a modell to make sure, whether the class is involved in such a relationship.
A resolution to bug 75922 should reduce the overhead of querying reverse references, at which time it may be practical to add methods to obtain, for example, the associations in which a type is involved. See also bug 85179 for a discussion of convenience methods related to relationships.
This bug will be resolved when (efficient) convenience methods are added for retrieving the relationships involving a given element. *** This bug has been marked as a duplicate of 85179 ***