Previous Topic: REL_MUTL_EXCL (Mutually Exclusive Relationships)Next Topic: Activity-Related Objects


Task

Select the mutually exclusive relationships from each of the entity types in a model.

SELECT E.NAME, R.NAME, X.ID, X.ENTITY_ID
  FROM
  MODEL M,,
  ENTITY_TYPE E,
  REL_MUTL_EXCL X,
  RELATIONSHIP R
  WHERE
  M.NAME = 'my model name'
  AND E.MODEL_ID = M.ID
  AND R.MODEL_ID = M.ID
  AND X.ENTITY_ID = E.ID
  AND X.RELATIONSHIP_ID = R.ID
ORDER BY X.ID, X.ENTITY_ID;

Those relationships for which X.ID and X.Entity_ID are th

e same are mutually exclusive relationships of entity type E.Name. For example, in the illustration Mutually Exclusive Relationship, Entity Type A has a mutually exclusive relationship with Entity Type B and Entity Type C.

Mutually Exclusive Relationship

If M.ID is 28, the records selected from the REL_MUTL_EXCL table might look like those in the next table.

In the following table, the object IDs are the same and the Entity Type IDs are the same (16 and 10, respectively):

Model_ID

Table Name

ID

Entity_ID

Relationship_ID

28

REL_MUTL_EXCL

16

10

40

28

REL_MUTL_EXCL

16

10

50